-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Otavio Salvador <[email protected]>
- Loading branch information
0 parents
commit f5d6c7c
Showing
40 changed files
with
1,142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
target-branch: "master" | ||
schedule: | ||
interval: "weekly" | ||
commit-message: | ||
prefix: "ci:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: "CI" | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**.nix' | ||
- 'flake.lock' | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- '**.nix' | ||
- 'flake.lock' | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Nix | ||
uses: nixbuild/nix-quick-install-action@v22 | ||
with: | ||
nix_conf: experimental-features = nix-command flakes repl-flake | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: otavio-nix-config | ||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
- run: nix flake check | ||
|
||
nixos: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
nixosConfiguration: | ||
- centrium | ||
- hyper | ||
- pikachu | ||
steps: | ||
- run: sudo apt-get clean | ||
- uses: actions/checkout@v3 | ||
- name: Install Nix | ||
uses: nixbuild/nix-quick-install-action@v22 | ||
with: | ||
nix_conf: experimental-features = nix-command flakes repl-flake | ||
- run: nix -Lv build ".#nixosConfigurations.${{ matrix.nixosConfiguration }}.config.system.build.toplevel" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: update-flake-lock | ||
on: | ||
workflow_dispatch: # allows manual triggering | ||
schedule: | ||
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00 | ||
|
||
jobs: | ||
lockfile: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install Nix | ||
uses: nixbuild/nix-quick-install-action@v22 | ||
with: | ||
nix_conf: experimental-features = nix-command flakes repl-flake | ||
- name: Update flake.lock | ||
id: update | ||
uses: DeterminateSystems/update-flake-lock@v19 | ||
with: | ||
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} | ||
- name: Print PR number | ||
run: echo Pull request number is ${{ steps.update.outputs.pull-request-number }}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*~ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
description = "Otavio Salvador's NixOS/Home Manager config"; | ||
|
||
inputs = { | ||
nixpkgs.url = "nixpkgs/nixos-23.05"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
home-manager = { | ||
url = "github:nix-community/home-manager/release-23.05"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
vscode-server.url = "github:nix-community/nixos-vscode-server"; | ||
nixos-hardware.url = "nixos-hardware"; | ||
disko.url = "github:nix-community/disko"; | ||
}; | ||
|
||
outputs = { self, ... }@inputs: | ||
let | ||
inherit (self) outputs; | ||
lib = import ./lib { inherit inputs outputs; }; | ||
in | ||
{ | ||
overlays = import ./overlays { inherit inputs outputs; }; | ||
|
||
nixosConfigurations = { | ||
centrium = lib.mkSystem { | ||
hostname = "centrium"; | ||
system = "x86_64-linux"; | ||
}; | ||
|
||
hyper = lib.mkSystem { | ||
hostname = "hyper"; | ||
system = "x86_64-linux"; | ||
}; | ||
|
||
pikachu = lib.mkSystem { | ||
hostname = "pikachu"; | ||
system = "x86_64-linux"; | ||
}; | ||
}; | ||
|
||
packages = builtins.foldl' | ||
(packages: hostname: | ||
let | ||
inherit (self.nixosConfigurations.${hostname}.config.nixpkgs) system; | ||
targetConfiguration = self.nixosConfigurations.${hostname}; | ||
in | ||
packages // { | ||
${system} = (packages.${system} or { }) // { | ||
"${hostname}-install-iso" = lib.mkInstallerForSystem { inherit hostname targetConfiguration system; }; | ||
}; | ||
}) | ||
{ } | ||
(builtins.attrNames self.nixosConfigurations); | ||
} // inputs.flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: | ||
let | ||
inherit (self) outputs; | ||
pkgs = import inputs.nixpkgs { inherit system outputs; }; | ||
in | ||
{ | ||
formatter = pkgs.writeShellApplication { | ||
name = "normalise_nix"; | ||
runtimeInputs = with pkgs; [ nixpkgs-fmt statix ]; | ||
text = '' | ||
set -o xtrace | ||
nixpkgs-fmt "$@" | ||
statix fix "$@" | ||
''; | ||
}; | ||
|
||
checks = { | ||
lint = pkgs.runCommand "lint-code" { nativeBuildInputs = with pkgs; [ nixpkgs-fmt deadnix statix ]; } '' | ||
deadnix --fail ${./.} | ||
#statix check ${./.} # https://github.com/nerdypepper/statix/issues/75 | ||
nixpkgs-fmt --check ${./.} | ||
touch $out | ||
''; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ inputs, ... }: | ||
|
||
{ | ||
imports = with inputs.nixos-hardware.nixosModules; [ | ||
common-cpu-intel | ||
common-pc-ssd | ||
] ++ [ | ||
../features/required | ||
|
||
./partitioning.nix | ||
]; | ||
|
||
boot = { | ||
loader.systemd-boot.enable = true; | ||
loader.efi.canTouchEfiVariables = true; | ||
|
||
initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" ]; | ||
initrd.kernelModules = [ ]; | ||
|
||
kernelModules = [ "kvm-intel" ]; | ||
}; | ||
} |
Oops, something went wrong.