Move NixOS and home-manager stable to 22.05

This commit is contained in:
2022-05-28 18:38:03 +01:00
parent 64def7f564
commit c841b37f19
14 changed files with 128 additions and 103 deletions

View File

@@ -1,8 +1,8 @@
{
nixos.systems.colony = {
system = "x86_64-linux";
nixpkgs = "mine";
home-manager = "unstable";
nixpkgs = "mine-stable";
home-manager = "mine-stable";
assignments = {
internal = {

View File

@@ -15,25 +15,15 @@ let
defs,
}:
let
# The flake contains `nixosSystem`, so we do need it (if we didn't have the TODO hacked version anyway)
# The flake contains `nixosSystem`, so we do need it
pkgsFlake = pkgsFlakes.${config'.nixpkgs};
# TODO: This is mostly yoinked from nixpkgs/flake.nix master (as of 2022/02/11) since 21.11's version has hacky
# vm build stuff that breaks our impl. REMOVE WHEN 22.05 IS OUT!
nixosSystem' = args:
import "${pkgsFlake}/nixos/lib/eval-config.nix" (args // {
modules = args.modules ++ [{
system.nixos.versionSuffix =
".${substring 0 8 pkgsFlake.lastModifiedDate}.${pkgsFlake.shortRev}";
system.nixos.revision = pkgsFlake.rev;
}];
});
pkgs = pkgs'.${config'.nixpkgs}.${config'.system};
allPkgs = mapAttrs (_: p: p.${config'.system}) pkgs';
modules' = [ hmFlakes.${config'.home-manager}.nixosModule ] ++ (attrValues cfg.modules);
in
nixosSystem' {
pkgsFlake.lib.nixosSystem {
# Gotta override lib here unforunately, eval-config.nix likes to import its own (unextended) lib. We explicitly
# don't pass pkgs so that it'll be imported with modularly applied config and overlays.
lib = pkgs.lib;
@@ -75,7 +65,7 @@ let
home-manager = {
extraSpecialArgs = { inherit inputs; };
# Optimise if system and home-manager nixpkgs are the same
useGlobalPkgs = mkDefault (config'.nixpkgs == config'.home-manager);
useGlobalPkgs = mkDefault (config'.nixpkgs == config'.hmNixpkgs);
sharedModules = (attrValues config.home-manager.modules) ++ [
{
warnings = flatten [
@@ -142,6 +132,11 @@ let
};
};
};
config = {
home-manager = mkDefault config.nixpkgs;
hmNixpkgs = mkDefault config.nixpkgs;
};
};
in
{

View File

@@ -1,7 +1,7 @@
{
nixos.systems.installer = {
system = "x86_64-linux";
nixpkgs = "mine";
nixpkgs = "unstable";
docCustom = false;
configuration =

View File

@@ -6,16 +6,12 @@ let
cfg = config.my.build;
asDevVM = extendModules {
# TODO: Hack because this is kinda broken on 21.11 (https://github.com/NixOS/nixpkgs/issues/148343)
specialArgs = { inherit baseModules; };
modules = [
"${modulesPath}/virtualisation/qemu-vm.nix"
{ my.build.isDevVM = true; }
];
};
asISO = extendModules {
# TODO: see previous
specialArgs = { inherit baseModules; };
modules = lib.flatten [
"${modulesPath}/installer/cd-dvd/iso-image.nix"
(lib.optional config.my.build.allHardware { imports = [ "${modulesPath}/profiles/all-hardware.nix" ]; })
@@ -32,8 +28,6 @@ let
];
};
asContainer = extendModules {
# TODO: see previous
specialArgs = { inherit baseModules; };
modules = [
{
boot.isContainer = true;

View File

@@ -25,7 +25,7 @@ in
config = mkMerge [
{
system = {
stateVersion = "21.11";
stateVersion = "22.05";
configurationRevision = with inputs; mkIf (self ? rev) self.rev;
};
@@ -48,12 +48,10 @@ in
nix = {
package = pkgs'.mine.nix;
# TODO: This has been renamed to nix.settings.trusted-users in 22.05
trustedUsers = [ "@wheel" ];
extraOptions =
''
experimental-features = nix-command flakes ca-derivations
'';
settings = {
trusted-users = [ "@wheel" ];
experimental-features = [ "nix-command" "flakes" "ca-derivations" ];
};
};
nixpkgs = {
overlays = [

View File

@@ -220,6 +220,9 @@ in
my.tmproot.persistence.config.files =
concatMap (k: [ k.path "${k.path}.pub" ]) config.services.openssh.hostKeys;
})
(mkIf config.services.logrotate.enable {
my.tmproot.persistence.config.files = [ "/var/lib/logrotate.status" ];
})
(mkIf config.my.build.isDevVM {
fileSystems = mkVMOverride {
# Hijack the "root" device for persistence in the VM

View File

@@ -2,7 +2,7 @@
nixos.systems.estuary = {
system = "x86_64-linux";
nixpkgs = "mine";
home-manager = "unstable";
home-manager = "mine";
assignments.internal = {
name = "estuary-vm";