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