diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..3550a30f --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index b2be92b7..726d2d63 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ result +.direnv diff --git a/common/pkgs.nix b/common/pkgs.nix index 735e2942..89eabf64 100644 --- a/common/pkgs.nix +++ b/common/pkgs.nix @@ -3,5 +3,5 @@ self, ... }: { - environment.systemPackages = (with pkgs; [git inxi python3]) ++ [self.inputs.agenix.packages.${pkgs.system}.default]; + environment.systemPackages = with pkgs; [git inxi python3]; } diff --git a/flake.nix b/flake.nix index 687ca011..2e280c84 100644 --- a/flake.nix +++ b/flake.nix @@ -58,17 +58,18 @@ }; outputs = {self, ...}: let - forDefaultSystems = self.inputs.nixpkgs.lib.genAttrs [ + allSystems = [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; - forLinuxSystems = self.inputs.nixpkgs.lib.genAttrs [ - "aarch64-linux" - "x86_64-linux" - ]; + forAllSystems = f: + self.inputs.nixpkgs.lib.genAttrs allSystems (system: + f { + pkgs = import self.inputs.nixpkgs {inherit system;}; + }); forAllHosts = self.inputs.nixpkgs.lib.genAttrs [ "fallarbor" @@ -79,10 +80,28 @@ "slateport" ]; in { - formatter = forDefaultSystems (system: self.inputs.nixpkgs.legacyPackages.${system}.alejandra); + devShells = forAllSystems ({pkgs}: { + default = pkgs.mkShell { + packages = + (with pkgs; [ + git + nh + mdformat + ruby + update-nix-fetchgit + ]) + ++ [ + self.formatter.${pkgs.system} + self.inputs.agenix.packages.${pkgs.system}.default + self.packages.${pkgs.system}.default + ]; + }; + }); - packages = forLinuxSystems (system: { - default = self.inputs.nixpkgs.legacyPackages."${system}".writeShellApplication { + formatter = forAllSystems ({pkgs}: pkgs.alejandra); + + packages = forAllSystems ({pkgs}: { + default = pkgs.writeShellApplication { name = "clean-install"; text = ./flake/clean-install.sh; };