Skip to content

Commit

Permalink
feat!(nix): remove default values for the stateVersion options
Browse files Browse the repository at this point in the history
  • Loading branch information
midchildan committed Dec 3, 2023
1 parent e7c2d04 commit 406ea96
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 98 deletions.
96 changes: 21 additions & 75 deletions nix/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,85 +39,31 @@ in
default = "nix_2_18";
};

home = {
modules = lib.mkOption {
type = with lib.types; listOf deferredModule;
default = [ ];
description = ''
Default list of modules to include when generating Home Manager
configuration with `lib.mkHome` and `lib.importHome`.
'';
};

stateVersion = lib.mkOption {
type = lib.types.str;
default = nixosRelease;
description = ''
The default `stateVersion` to use for Home Manager.
More info is available at
<https://nix-community.github.io/home-manager/options.html#opt-home.stateVersion>.
::: {.warning}
Make sure to understand what the following does. It's strongly
recommended to override this option this per host.
:::
'';
};
home.modules = lib.mkOption {
type = with lib.types; listOf deferredModule;
default = [ ];
description = ''
Default list of modules to include when generating Home Manager
configuration with `lib.mkHome` and `lib.importHome`.
'';
};

nixos = {
modules = lib.mkOption {
type = with lib.types; listOf deferredModule;
default = [ ];
description = ''
Default list of modules to include when generating NixOS configuration
with `lib.mkNixOS` and `lib.importNixOS`.
'';
};

stateVersion = lib.mkOption {
type = lib.types.str;
default = nixosRelease;
description = ''
The default `stateVersion` to use for NixOS.
More info is available at
<https://search.nixos.org/options?show=system.stateVersion>.
::: {.warning}
Make sure to understand what the following does. It's strongly
recommended to override this option this per host.
:::
'';
};
nixos.modules = lib.mkOption {
type = with lib.types; listOf deferredModule;
default = [ ];
description = ''
Default list of modules to include when generating NixOS configuration
with `lib.mkNixOS` and `lib.importNixOS`.
'';
};

darwin = {
modules = lib.mkOption {
type = with lib.types; listOf deferredModule;
default = [ ];
description = ''
Default list of modules to include when generating nix-darwin
configuration with `lib.mkDarwin` and `lib.importDarwin`.
'';
};

stateVersion = lib.mkOption {
type = lib.types.ints.positive;
default = 4;
description = ''
The default `stateVersion` to use for nix-darwin.
More info is available at
<https://daiderd.com/nix-darwin/manual/index.html#opt-system.stateVersion>.
::: {.warning}
Make sure to understand what the following does. It's strongly
recommended to override this option this per host.
:::
'';
};
darwin.modules = lib.mkOption {
type = with lib.types; listOf deferredModule;
default = [ ];
description = ''
Default list of modules to include when generating nix-darwin
configuration with `lib.mkDarwin` and `lib.importDarwin`.
'';
};
};
}
1 change: 0 additions & 1 deletion nix/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
./modules/setup.nix
./modules/nix.nix
./modules/shell.nix
./profiles/common.nix
./profiles/apps.nix
];

Expand Down
3 changes: 3 additions & 0 deletions nix/darwin/machines/ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ in
enableAll = true;
extras.enable = false;
};
home.stateVersion = "23.11";
};

system.stateVersion = 4;
}
8 changes: 0 additions & 8 deletions nix/darwin/profiles/common.nix

This file was deleted.

1 change: 1 addition & 0 deletions nix/home/machines/ci.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
dotfiles.profiles.enableAll = true;
programs.home-manager.enable = true;
home.stateVersion = "23.11";
}
8 changes: 0 additions & 8 deletions nix/home/profiles/common.nix

This file was deleted.

1 change: 0 additions & 1 deletion nix/home/profiles/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

{
imports = [
./common.nix
./minimal.nix
./essential.nix
./extras.nix
Expand Down
2 changes: 2 additions & 0 deletions nix/nixos/machines/ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ in
};

users.users.${username}.password = "";

system.stateVersion = "23.11";
}
2 changes: 0 additions & 2 deletions nix/nixos/profiles/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ in
nix.extraOptions = ''
experimental-features = nix-command flakes
'';

system.stateVersion = lib.mkDefault flakeOptions.nixos.stateVersion;
};
}
2 changes: 1 addition & 1 deletion nix/templates/darwin/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Options are defined in:
# https://github.com/midchildan/dotfiles/blob/nix/home
dotfiles.profiles.enableAll = true;
home.stateVersion = "23.05";
home.stateVersion = "23.11";
};
}];
};
Expand Down
2 changes: 1 addition & 1 deletion nix/templates/home/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# Options are defined in:
# https://github.com/midchildan/dotfiles/blob/nix/home
dotfiles.profiles.enableAll = true;
home.stateVersion = "23.05";
home.stateVersion = "23.11";
}];
};
};
Expand Down
2 changes: 1 addition & 1 deletion nix/templates/nixos/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
network.enable = true;
desktop.enable = true;
};
system.stateVersion = "23.05";
system.stateVersion = "23.11";
}];
};
});
Expand Down

0 comments on commit 406ea96

Please sign in to comment.