summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-08 16:24:00 -0700
committerFuwn <[email protected]>2024-10-08 16:24:00 -0700
commit09cb21d49762859966c0b3a814ff205d60fe6a22 (patch)
treecfe2a48c0b5fdc0baf00a986bda2bd59a8dfa1a3 /flake.nix
parentcaddy-tailscale: fix version (diff)
downloadnixos-config-09cb21d49762859966c0b3a814ff205d60fe6a22.tar.xz
nixos-config-09cb21d49762859966c0b3a814ff205d60fe6a22.zip
flake: move perSystem attributes to parts
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix82
1 files changed, 18 insertions, 64 deletions
diff --git a/flake.nix b/flake.nix
index 1242c6c..00e93cc 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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
- ];
- };
};
};