From 6f53cb5f4a4294e34cb70f14dde8443a821974ea Mon Sep 17 00:00:00 2001 From: truxnell <19149206+truxnell@users.noreply.github.com> Date: Tue, 26 Mar 2024 21:16:21 +1100 Subject: [PATCH 1/3] feat: add auto lint workflow --- .github/workflows/nix-lint.yaml | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/nix-lint.yaml diff --git a/.github/workflows/nix-lint.yaml b/.github/workflows/nix-lint.yaml new file mode 100644 index 0000000..9c7738f --- /dev/null +++ b/.github/workflows/nix-lint.yaml @@ -0,0 +1,46 @@ +name: Nix Flake Check + +on: [pull_request] + +jobs: + check: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Nix + uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Install Nix Linting and Formatting Tools + run: nix-env -i statix nixpkgs-fmt -f '' + + - name: Run Statix Lint + run: statix fix + + - name: Run Nix Format + run: nix fmt + + - name: Nix Flake Checker + # You may pin to the exact commit or the version. + # uses: DeterminateSystems/flake-checker-action@4b90f9fc724969ff153fe1803460917c84fe00a3 + uses: DeterminateSystems/flake-checker-action@v5 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + + - name: Generate Readme + run: python3 sh/readme.py + + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Auto lint/format \ No newline at end of file From 3f35dbbb35cc8c8b4de1a8aa24237cbdd9dbcf78 Mon Sep 17 00:00:00 2001 From: truxnell <19149206+truxnell@users.noreply.github.com> Date: Tue, 26 Mar 2024 21:25:05 +1100 Subject: [PATCH 2/3] fix: remove python stuff --- .github/workflows/nix-lint.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/nix-lint.yaml b/.github/workflows/nix-lint.yaml index 9c7738f..c7338f7 100644 --- a/.github/workflows/nix-lint.yaml +++ b/.github/workflows/nix-lint.yaml @@ -32,14 +32,6 @@ jobs: # uses: DeterminateSystems/flake-checker-action@4b90f9fc724969ff153fe1803460917c84fe00a3 uses: DeterminateSystems/flake-checker-action@v5 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - - name: Generate Readme - run: python3 sh/readme.py - - name: Commit uses: stefanzweifel/git-auto-commit-action@v5 with: From 098865c5009664d477fab6a692fe5dd65a8d5ff2 Mon Sep 17 00:00:00 2001 From: truxnell Date: Tue, 26 Mar 2024 10:26:12 +0000 Subject: [PATCH 3/3] Auto lint/format --- nixos/hosts/citadel/default.nix | 4 ++-- nixos/hosts/citadel/hardware-configuration.nix | 9 ++++++--- nixos/hosts/common/nixos/openssh.nix | 3 +-- .../hosts/common/optional/editors/vscode/extensions.nix | 2 +- nixos/hosts/dns01/hardware-configuration.nix | 6 ++++-- nixos/hosts/rickenbacker/hardware-configuration.nix | 9 ++++++--- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/nixos/hosts/citadel/default.nix b/nixos/hosts/citadel/default.nix index 3838124..ec7df51 100644 --- a/nixos/hosts/citadel/default.nix +++ b/nixos/hosts/citadel/default.nix @@ -29,7 +29,7 @@ networking.hostName = "citadel"; # Define your hostname. - # Enable OpenGL + # Enable OpenGL hardware.opengl = { enable = true; driSupport = true; @@ -37,7 +37,7 @@ }; # Load nvidia driver for Xorg and Wayland - services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc. + services.xserver.videoDrivers = [ "nvidia" ]; # or "nvidiaLegacy470 etc. hardware.nvidia = { diff --git a/nixos/hosts/citadel/hardware-configuration.nix b/nixos/hosts/citadel/hardware-configuration.nix index 09462b7..5a06546 100644 --- a/nixos/hosts/citadel/hardware-configuration.nix +++ b/nixos/hosts/citadel/hardware-configuration.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; @@ -14,12 +15,14 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/701fc943-ede7-41ed-8a53-3cc38fc68fe5"; + { + device = "/dev/disk/by-uuid/701fc943-ede7-41ed-8a53-3cc38fc68fe5"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/C634-F571"; + { + device = "/dev/disk/by-uuid/C634-F571"; fsType = "vfat"; }; diff --git a/nixos/hosts/common/nixos/openssh.nix b/nixos/hosts/common/nixos/openssh.nix index b852733..8d3c10e 100644 --- a/nixos/hosts/common/nixos/openssh.nix +++ b/nixos/hosts/common/nixos/openssh.nix @@ -1,5 +1,4 @@ -{... -}: +_: { diff --git a/nixos/hosts/common/optional/editors/vscode/extensions.nix b/nixos/hosts/common/optional/editors/vscode/extensions.nix index 9b24a06..a84a0cd 100644 --- a/nixos/hosts/common/optional/editors/vscode/extensions.nix +++ b/nixos/hosts/common/optional/editors/vscode/extensions.nix @@ -1,7 +1,7 @@ # Warning, this file is autogenerated by nix4vscode. Don't modify this manually. { pkgs }: let - vscode-utils = pkgs.vscode-utils; + inherit (pkgs) vscode-utils; in { "ms-python"."python" = vscode-utils.extensionFromVscodeMarketplace { diff --git a/nixos/hosts/dns01/hardware-configuration.nix b/nixos/hosts/dns01/hardware-configuration.nix index e2b253d..cb81550 100644 --- a/nixos/hosts/dns01/hardware-configuration.nix +++ b/nixos/hosts/dns01/hardware-configuration.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "usb_storage" ]; @@ -14,7 +15,8 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + { + device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; fsType = "ext4"; }; diff --git a/nixos/hosts/rickenbacker/hardware-configuration.nix b/nixos/hosts/rickenbacker/hardware-configuration.nix index 3e84390..0e3b9a1 100644 --- a/nixos/hosts/rickenbacker/hardware-configuration.nix +++ b/nixos/hosts/rickenbacker/hardware-configuration.nix @@ -5,7 +5,8 @@ { imports = - [ (modulesPath + "/installer/scan/not-detected.nix") + [ + (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; @@ -14,12 +15,14 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/fe728106-aaf8-46e6-ab46-1610f1f4398a"; + { + device = "/dev/disk/by-uuid/fe728106-aaf8-46e6-ab46-1610f1f4398a"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/44D0-91EC"; + { + device = "/dev/disk/by-uuid/44D0-91EC"; fsType = "vfat"; };