add mkSystem and dev.nix
This commit is contained in:
parent
a261e122e6
commit
89f997e158
3 changed files with 33 additions and 28 deletions
2
.envrc
2
.envrc
|
@ -1,2 +1,2 @@
|
||||||
use flake
|
use flake
|
||||||
watch_file flake.nix
|
watch_file dev.nix
|
||||||
|
|
14
dev.nix
Normal file
14
dev.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
perSystem = {pkgs, ...}: {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [
|
||||||
|
alejandra
|
||||||
|
fzf
|
||||||
|
just
|
||||||
|
nil
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
formatter = pkgs.alejandra;
|
||||||
|
};
|
||||||
|
}
|
45
flake.nix
45
flake.nix
|
@ -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;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue