flake: add devShelland direnv

This commit is contained in:
Aly Raffauf 2024-09-05 22:41:27 -04:00
parent 2d597195b3
commit 22388ecc9f
4 changed files with 30 additions and 9 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View file

@ -1 +1,2 @@
result result
.direnv

View file

@ -3,5 +3,5 @@
self, self,
... ...
}: { }: {
environment.systemPackages = (with pkgs; [git inxi python3]) ++ [self.inputs.agenix.packages.${pkgs.system}.default]; environment.systemPackages = with pkgs; [git inxi python3];
} }

View file

@ -58,17 +58,18 @@
}; };
outputs = {self, ...}: let outputs = {self, ...}: let
forDefaultSystems = self.inputs.nixpkgs.lib.genAttrs [ allSystems = [
"aarch64-linux" "aarch64-linux"
"x86_64-linux" "x86_64-linux"
"aarch64-darwin" "aarch64-darwin"
"x86_64-darwin" "x86_64-darwin"
]; ];
forLinuxSystems = self.inputs.nixpkgs.lib.genAttrs [ forAllSystems = f:
"aarch64-linux" self.inputs.nixpkgs.lib.genAttrs allSystems (system:
"x86_64-linux" f {
]; pkgs = import self.inputs.nixpkgs {inherit system;};
});
forAllHosts = self.inputs.nixpkgs.lib.genAttrs [ forAllHosts = self.inputs.nixpkgs.lib.genAttrs [
"fallarbor" "fallarbor"
@ -79,10 +80,28 @@
"slateport" "slateport"
]; ];
in { 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: { formatter = forAllSystems ({pkgs}: pkgs.alejandra);
default = self.inputs.nixpkgs.legacyPackages."${system}".writeShellApplication {
packages = forAllSystems ({pkgs}: {
default = pkgs.writeShellApplication {
name = "clean-install"; name = "clean-install";
text = ./flake/clean-install.sh; text = ./flake/clean-install.sh;
}; };