diff options
| author | Fuwn <[email protected]> | 2024-10-08 16:24:00 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-08 16:24:00 -0700 |
| commit | 09cb21d49762859966c0b3a814ff205d60fe6a22 (patch) | |
| tree | cfe2a48c0b5fdc0baf00a986bda2bd59a8dfa1a3 /flake.nix | |
| parent | caddy-tailscale: fix version (diff) | |
| download | nixos-config-09cb21d49762859966c0b3a814ff205d60fe6a22.tar.xz nixos-config-09cb21d49762859966c0b3a814ff205d60fe6a22.zip | |
flake: move perSystem attributes to parts
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 82 |
1 files changed, 18 insertions, 64 deletions
@@ -63,72 +63,26 @@ pkgs = (kansaiPkgs { })."${system}"; in { + imports = + let + parts = "${self}/parts"; + in + [ + "${parts}/just.nix" + (import "${parts}/checks.nix" { inherit pre-commit-hooks system; }) + + (import "${parts}/dev-shells.nix" { + inherit + config + pkgs + self + system + ; + }) + ]; + packages.default = home-manager.defaultPackage."${system}"; formatter = pkgs.nixfmt-rfc-style; - - just-flake.features.default = { - enable = true; - - justfile = '' - action target action: - git add . && nix develop --command rui --allow-unfree --allow-insecure {{target}} {{action}} -- --impure - - build target: - just action {{target}} build - - switch target: - just action {{target}} switch - - news user='ebisu': - rui home news --user {{user}} -- --impure - - check: - nix develop --command nix flake check - - push message: - git add . && git commit -m "{{message}}" && git push origin main - - commit message: - git add . && git commit -m "{{message}}" - - restore: - git restore --staged . && git restore . - - deploy hostname user='root': - git add . && nixos-rebuild \ - --flake .#{{hostname}} \ - --target-host {{user}}@{{hostname}} \ - --use-remote-sudo \ - switch - - provision ip hostname: - doas nix run github:nix-community/nixos-anywhere \ - -- \ - --flake .#{{hostname}} root@{{ip}} - ''; - }; - - checks.pre-commit-check = pre-commit-hooks.lib.${system}.run { - src = ./.; - - hooks = { - deadnix.enable = true; - flake-checker.enable = true; - nixfmt-rfc-style.enable = true; - statix.enable = true; - }; - }; - - devShells.default = pkgs.mkShell { - inherit (self.checks.${system}.pre-commit-check) shellHook; - - buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; - - inputsFrom = [ - config.flake-root.devShell - config.just-flake.outputs.devShell - ]; - }; }; }; |