diff --git a/flake.nix b/flake.nix index b9f8499..f4d6906 100644 --- a/flake.nix +++ b/flake.nix @@ -23,8 +23,8 @@ in { devShell.x86_64-linux = shell.dev; - formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; + packages = shell.packages; nixosConfigurations = { eve-psr-nix0 = nixpkgs.lib.nixosSystem { diff --git a/shell.nix b/shell.nix index 1929c91..66ec50e 100644 --- a/shell.nix +++ b/shell.nix @@ -6,8 +6,20 @@ pkgs.terraform ]; shellHook = '' - deploy() { nixos-rebuild switch --target-host root@matri.cx --build-host root@matri.cx --flake .#eve-psr-nix0 ; } - fmt() { nix fmt *.nix; for i in */; do cd $i; nix fmt *.nix; cd ..; done ; } ''; }; + + packages = { + x86_64-linux = { + deploy = pkgs.writeShellScriptBin "deploy" '' + nixos-rebuild switch --target-host root@matri.cx --build-host root@matri.cx --flake .#eve-psr-nix0 ; + ''; + format = pkgs.writeShellScriptBin "format" '' + nix fmt ./*.nix; + for i in */; do + nix fmt $i/*.nix; + done; + ''; + }; + }; }