repo: init
This commit is contained in:
commit
8dd5ce867a
6 changed files with 274 additions and 0 deletions
59
lib/default.nix
Normal file
59
lib/default.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{inputs}: _: _: let
|
||||
mkComputer = {
|
||||
host,
|
||||
system,
|
||||
user,
|
||||
extraModules ? [],
|
||||
}:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules =
|
||||
extraModules
|
||||
++ [
|
||||
./computers/${host}
|
||||
({config, ...}: {
|
||||
config = {
|
||||
nix = {
|
||||
settings.extra-experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
};
|
||||
};
|
||||
programs.fish = {
|
||||
vendor = {
|
||||
functions.enable = true;
|
||||
config.enable = true;
|
||||
completions.enable = true;
|
||||
};
|
||||
enable = true;
|
||||
};
|
||||
users = {
|
||||
users.${user} = {
|
||||
isNormalUser = true;
|
||||
useDefaultShell = true;
|
||||
initialPassword = "password";
|
||||
extraGroups = ["wheel" "networkmanager" "video" "audio" "input" "libvirtd"];
|
||||
name = user;
|
||||
};
|
||||
defaultUserShell = config.programs.fish.package;
|
||||
};
|
||||
environment.shellAliases = {
|
||||
rebs = "nixos-rebuild --use-remote-sudo switch --flake .#${host}";
|
||||
rebt = "nixos-rebuild --use-remote-sudo test --flake .#${host}";
|
||||
};
|
||||
networking.hostName = host;
|
||||
};
|
||||
})
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit (inputs) self;
|
||||
};
|
||||
};
|
||||
in {
|
||||
mkComputers = computers: builtins.mapAttrs (n: v: mkComputer (v // {host = n;})) computers;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue