add mkSystem and dev.nix

This commit is contained in:
uku 2023-11-14 17:36:02 +01:00
parent a261e122e6
commit 89f997e158
Signed by: uku
GPG key ID: 7D01D7B105E77166
3 changed files with 33 additions and 28 deletions

2
.envrc
View file

@ -1,2 +1,2 @@
use flake use flake
watch_file flake.nix watch_file dev.nix

14
dev.nix Normal file
View file

@ -0,0 +1,14 @@
{
perSystem = {pkgs, ...}: {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
alejandra
fzf
just
nil
];
};
formatter = pkgs.alejandra;
};
}

View file

@ -41,42 +41,33 @@
flake-parts.lib.mkFlake {inherit inputs;} { flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"]; systems = ["x86_64-linux"];
imports = [./dev.nix];
flake = let flake = let
mkSystem = name: mkSystem = modules: name:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules =
./common.nix [
./${name}
./${name}/hardware-configuration.nix
./${name} {networking.hostName = name;}
./${name}/hardware-configuration.nix ]
++ modules;
{networking.hostName = name;}
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager
];
specialArgs = inputs; specialArgs = inputs;
}; };
in {
nixosConfigurations = nixpkgs.lib.genAttrs ["fuji" "kilimandjaro"] mkSystem;
};
perSystem = {system, ...}: let mkDesktop = mkSystem [
pkgs = import nixpkgs { ./common.nix
inherit system; lanzaboote.nixosModules.lanzaboote
}; home-manager.nixosModules.home-manager
];
in { in {
devShells.default = pkgs.mkShell { nixosConfigurations = {
packages = with pkgs; [ fuji = mkDesktop "fuji";
alejandra kilimandjaro = mkDesktop "kilimandjaro";
fzf
just
nil
];
}; };
formatter = pkgs.alejandra;
}; };
}; };
} }