diff --git a/.envrc b/.envrc index 6a37c4f..3140b68 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1,3 @@ -#!/bin/sh - watch_file devshell.nix use flake diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 512e01e..49f19df 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,4 +4,4 @@ updates: directory: "/" schedule: interval: "weekly" - assignees: ["dadada"] + assignees: [ "dadada" ] diff --git a/.github/workflows/nix-flake-check.yml b/.github/workflows/nix-flake-check.yml index 28b1d3c..b0c0fa3 100644 --- a/.github/workflows/nix-flake-check.yml +++ b/.github/workflows/nix-flake-check.yml @@ -1,24 +1,26 @@ name: Continuous Integration + on: pull_request: push: branches: [main] + jobs: checks: name: "Checks" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v26 - with: - nix_path: nixpkgs=channel:nixos-stable - extra_nix_config: | - experimental-features = nix-command flakes - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - system-features = nixos-test benchmark big-parallel kvm - - uses: cachix/cachix-action@v14 - with: - name: dadada - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - run: nix flake check + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + with: + nix_path: nixpkgs=channel:nixos-stable + extra_nix_config: | + experimental-features = nix-command flakes + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + system-features = nixos-test benchmark big-parallel kvm + - uses: cachix/cachix-action@v14 + with: + name: dadada + signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix flake check diff --git a/.github/workflows/nix-flake-update.yml b/.github/workflows/nix-flake-update.yml index 33843d1..9045f91 100644 --- a/.github/workflows/nix-flake-update.yml +++ b/.github/workflows/nix-flake-update.yml @@ -3,6 +3,7 @@ on: workflow_dispatch: # allows manual triggering schedule: - cron: '0 0 * * 0' # runs weekly on Sunday at 00:00 + jobs: lockfile: runs-on: ubuntu-latest @@ -15,6 +16,6 @@ jobs: uses: DeterminateSystems/update-flake-lock@v21 with: pr-title: "Update flake.lock" # Title of PR to be created - pr-labels: | # Labels to be set on the PR + pr-labels: | # Labels to be set on the PR dependencies automated diff --git a/devshell.nix b/devshell.nix index 1fbad07..ebdfb12 100644 --- a/devshell.nix +++ b/devshell.nix @@ -24,7 +24,7 @@ name = "format"; help = "Format the project"; command = '' - treefmt . + nixpkgs-fmt . ''; category = "dev"; } diff --git a/nixos/configurations.nix b/nixos/configurations.nix index 95b894e..7a4185a 100644 --- a/nixos/configurations.nix +++ b/nixos/configurations.nix @@ -21,14 +21,15 @@ let nixpkgs.lib.nixosSystem { inherit system; - modules = [ - { - nixpkgs.overlays = nixpkgs.lib.attrValues self.overlays; - } - ] - ++ (nixpkgs.lib.attrValues self.nixosModules) - ++ [ agenix.nixosModules.age ] - ++ extraModules; + modules = + [ + { + nixpkgs.overlays = nixpkgs.lib.attrValues self.overlays; + } + ] + ++ (nixpkgs.lib.attrValues self.nixosModules) + ++ [ agenix.nixosModules.age ] + ++ extraModules; }; in { diff --git a/nixos/stolas/default.nix b/nixos/stolas/default.nix index 696f55f..1e29f6c 100644 --- a/nixos/stolas/default.nix +++ b/nixos/stolas/default.nix @@ -1,9 +1,4 @@ -{ - config, - lib, - pkgs, - ... -}: +{ config, lib, pkgs, ... }: { imports = [ @@ -128,8 +123,8 @@ snapshotInterval = "hourly"; configs = { home = { - SUBVOLUME = "/home/dadada"; - ALLOW_USERS = [ "dadada" ]; + SUBVOLUME = "/dadada"; + ALLOW_USERS= "dadada"; TIMELINE_CREATE = true; TIMELINE_CLEANUP = true; TIMELINE_MIN_AGE = "1800"; @@ -151,7 +146,7 @@ TIMELINE_LIMIT_YEARLY = "0"; }; paperless = { - SUBVOLUME = "/var/lib/paperless"; + SUBVOLUME = "/paperless"; TIMELINE_CREATE = true; TIMELINE_CLEANUP = true; TIMELINE_MIN_AGE = "3600"; @@ -218,7 +213,7 @@ # owner = "paperless"; # }; # }; - + # Create compressing swap space in RAM zramSwap.enable = true; } diff --git a/outputs.nix b/outputs.nix index c860d3c..aea7953 100644 --- a/outputs.nix +++ b/outputs.nix @@ -5,14 +5,12 @@ nixpkgs, agenix, devshell, - treefmt-nix, ... }@inputs: (flake-utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; }; - treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in { devShells.default = @@ -28,7 +26,7 @@ in import ./devshell.nix { inherit pkgs extraModules; }; - formatter = treefmtEval.config.build.wrapper; + formatter = pkgs.nixfmt-tree; packages = import ./pkgs { inherit pkgs; } // { installer-iso = self.nixosConfigurations.installer.config.system.build.isoImage; @@ -36,6 +34,7 @@ } )) // { + hmModules = import ./home/modules.nix { lib = nixpkgs.lib; }; nixosConfigurations = import ./nixos/configurations.nix inputs; diff --git a/pkgs/default.nix b/pkgs/default.nix index 9f52a8a..9cd9053 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,3 @@ -{ pkgs }: -{ - citizen-cups = pkgs.callPackage ./citizen-cups.nix { }; +{ pkgs }: { + citizen-cups = pkgs.callPackage ./citizen-cups.nix {}; } diff --git a/treefmt.nix b/treefmt.nix deleted file mode 100644 index 75acdfa..0000000 --- a/treefmt.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - projectRootFile = "flake.nix"; - programs.nixfmt.enable = true; - programs.shellcheck.enable = pkgs.hostPlatform.system != "riscv64-linux"; - programs.shfmt.enable = pkgs.hostPlatform.system != "riscv64-linux"; - programs.yamlfmt.enable = true; -}