move stateVersion to flake
This commit is contained in:
parent
e59bfab7a6
commit
6528ccbcde
43
flake.nix
43
flake.nix
|
@ -121,14 +121,9 @@
|
||||||
#"riscv64-linux"
|
#"riscv64-linux"
|
||||||
];
|
];
|
||||||
|
|
||||||
mkModule = hostname: domain: system: inputs: modules: ({ lib, ... }: {
|
mkModule = hostname: domain: system: inputs: stateVersion: modules: ({ lib, ... }: {
|
||||||
#TODO: fix infinite recursion:
|
system.stateVersion = lib.mkDefault stateVersion; # TODO: home-manager
|
||||||
/** /
|
|
||||||
_module.args = lib.mkFinal {
|
|
||||||
inherit inputs;
|
|
||||||
flakes = mkFlakeView inputs system;
|
|
||||||
};
|
|
||||||
/**/
|
|
||||||
imports = [
|
imports = [
|
||||||
./base.nix
|
./base.nix
|
||||||
"${self}/hosts/${hostname}"
|
"${self}/hosts/${hostname}"
|
||||||
|
@ -137,13 +132,11 @@
|
||||||
] ++ modules;
|
] ++ modules;
|
||||||
#++ inputs.flake-programs-sqlite.nixosModules.programs-sqlite; # TODO: make work
|
#++ inputs.flake-programs-sqlite.nixosModules.programs-sqlite; # TODO: make work
|
||||||
|
|
||||||
sops = {
|
sops.defaultSopsFile = lib.mkIf (builtins.pathExists ./secrets/${hostname}.yaml)
|
||||||
defaultSopsFile = lib.mkIf (builtins.pathExists ./secrets/${hostname}.yaml)
|
|
||||||
./secrets/${hostname}.yaml;
|
./secrets/${hostname}.yaml;
|
||||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
age.keyFile = "/var/lib/sops-nix/key.txt";
|
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||||
age.generateKey = true;
|
sops.age.generateKey = true;
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.useGlobalPkgs = true; # go brrr, reuse overrides
|
home-manager.useGlobalPkgs = true; # go brrr, reuse overrides
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = {
|
||||||
|
@ -169,7 +162,7 @@
|
||||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||||
nix.registry.nixpkgs-unstable.flake = inputs.unstable;
|
nix.registry.nixpkgs-unstable.flake = inputs.unstable;
|
||||||
nix.registry.nixpkgs-git = {
|
nix.registry.nixpkgs-git = {
|
||||||
from.id = "nixpkgs";
|
from.id = "nixpkgs-git";
|
||||||
from.type = "indirect";
|
from.type = "indirect";
|
||||||
to.type = "github";
|
to.type = "github";
|
||||||
to.owner = "NixOS";
|
to.owner = "NixOS";
|
||||||
|
@ -182,24 +175,24 @@
|
||||||
"nixpkgs-git=github:NixOS/nixpkgs/nixos-unstable-small"
|
"nixpkgs-git=github:NixOS/nixpkgs/nixos-unstable-small"
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
mkConfig = hostname: domain: system: inputs: modules: inputs.nixpkgs.lib.nixosSystem {
|
mkConfig = hostname: domain: system: inputs: stateVersion: modules: inputs.nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
flakes = mkFlakeView inputs system;
|
flakes = mkFlakeView inputs system;
|
||||||
};
|
};
|
||||||
modules = [ (mkModule hostname domain system inputs modules) ];
|
modules = [ (mkModule hostname domain system inputs stateVersion modules) ];
|
||||||
};
|
};
|
||||||
mkHosts = mk: with nixos-hardware.nixosModules; {
|
mkHosts = mk: with nixos-hardware.nixosModules; {
|
||||||
# TODO: move nixos-hardware imports to the nixos configs?
|
# TODO: move nixos-hardware imports to the nixos configs?
|
||||||
#attrpath "hostname" "domain" "system" inputs [ modules ... ]
|
#attrpath "hostname" "domain" "system" inputs "state" [ modules ... ]
|
||||||
noximilien = mk "noximilien" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-intel ];
|
noximilien = mk "noximilien" "pbsds.net" "x86_64-linux" inputs-2311 "22.11" [ common-pc common-pc-ssd common-cpu-intel ];
|
||||||
brumlebasse = mk "brumlebasse" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-amd ];
|
brumlebasse = mk "brumlebasse" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-amd ];
|
||||||
nord = mk "nord" "pbsds.net" "x86_64-linux" inputs-2305 [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-cpu-intel-sandy-bridge common-gpu-amd common-hidpi ];
|
nord = mk "nord" "pbsds.net" "x86_64-linux" inputs-2305 "22.11" [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-cpu-intel-sandy-bridge common-gpu-amd common-hidpi ];
|
||||||
sopp = mk "sopp" "pbsds.net" "x86_64-linux" inputs-2305 [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ];
|
sopp = mk "sopp" "pbsds.net" "x86_64-linux" inputs-2305 "23.05" [ common-pc common-pc-ssd common-cpu-intel common-gpu-nvidia-nonprime ];
|
||||||
bolle = mk "bolle" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-intel ];
|
bolle = mk "bolle" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-intel ];
|
||||||
eple = mk "eple" "pbsds.net" "x86_64-linux" inputs-2311 [ common-pc common-pc-ssd common-cpu-intel ];
|
eple = mk "eple" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-intel ];
|
||||||
garp = mk "garp" "pbsds.net" "x86_64-linux" inputs-2305 [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-gpu-nvidia-nonprime ];
|
garp = mk "garp" "pbsds.net" "x86_64-linux" inputs-2311 "23.11" [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-gpu-nvidia-nonprime ];
|
||||||
#gomperud smattkuken skrytebiffen skalkesnerken balleby brumlebasse bingus skjrlaltatjlstad
|
#gomperud smattkuken skrytebiffen skalkesnerken balleby brumlebasse bingus skjrlaltatjlstad
|
||||||
#bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke eple hasselknippe pytte uddu imdorf rosenqvist
|
#bergjlot snortheimsmoen ditlefsen skrukkerud podebusk zmaragd makrell alfnes blix urke eple hasselknippe pytte uddu imdorf rosenqvist
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,12 +55,4 @@
|
||||||
|
|
||||||
# TODO: remove? Move?
|
# TODO: remove? Move?
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "23.11"; # Did you read the comment?
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,12 +49,4 @@
|
||||||
|
|
||||||
# TODO: remove? Move?
|
# TODO: remove? Move?
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,12 +50,4 @@
|
||||||
|
|
||||||
# TODO: remove? Move?
|
# TODO: remove? Move?
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "23.11"; # Did you read the comment?
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,12 +62,4 @@
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "23.05"; # Did you read the comment?
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,12 +75,4 @@
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It's perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,12 +132,4 @@
|
||||||
|
|
||||||
# TODO: remove? Move?
|
# TODO: remove? Move?
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
|
||||||
# settings for stateful data, like file locations and database versions
|
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
||||||
# this value at the release version of the first install of this system.
|
|
||||||
# Before changing this value read the documentation for this option
|
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
||||||
system.stateVersion = "22.11"; # Did you read the comment?
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue