diff --git a/default.nix b/default.nix index 578d699..0b1d004 100644 --- a/default.nix +++ b/default.nix @@ -5,7 +5,6 @@ ./modules/backports.nix ./modules/baseline.nix ./modules/cli.nix - ./modules/flakes.nix ./modules/gnome.nix ./modules/phpipam.nix ./modules/plasma.nix diff --git a/flake.nix b/flake.nix index 1a43aae..a16d851 100644 --- a/flake.nix +++ b/flake.nix @@ -5,7 +5,6 @@ outputs = { self, unstable, stable2009 }: { nixosModule = { ... }: { imports = [ ./. ]; - config = { sconfig.flakes.enable = true; }; }; nixosConfigurations = import ./hosts { modules = [ ./. ]; inherit unstable stable2009; }; }; diff --git a/hosts/default.nix b/hosts/default.nix index 89c345c..edeab21 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -28,11 +28,7 @@ builtins.mapAttrs modules = modules ++ [ (./. + "/${n}/configuration.nix") (hardwareModule v.hardware) - ({ ... }: { - networking.hostName = n; - sconfig.flakes.enable = true; - sconfig.flakes.rebuildPath = "github:buckley310/nixos-config"; - }) + ({ ... }: { networking.hostName = n; }) ]; } ) diff --git a/modules/baseline.nix b/modules/baseline.nix index b40019e..964149b 100644 --- a/modules/baseline.nix +++ b/modules/baseline.nix @@ -25,6 +25,10 @@ nix = { daemonNiceLevel = 19; daemonIONiceLevel = 7; + package = pkgs.nixFlakes; + extraOptions = '' + experimental-features = nix-command flakes + ''; }; hardware = { diff --git a/modules/cli.nix b/modules/cli.nix index bf3d670..ad27401 100644 --- a/modules/cli.nix +++ b/modules/cli.nix @@ -8,6 +8,10 @@ let "-git-assume-unchanged-size 0" ]; + update-cmds = map + (x: (pkgs.writeShellScriptBin "sc-${x}" "nixos-rebuild ${x} --refresh --flake github:buckley310/nixos-config")) + [ "switch" "build" "boot" ]; + in { environment.systemPackages = with pkgs; [ @@ -65,7 +69,7 @@ in echo "$(curl --silent -L ${config.system.defaultChannel}/git-revision) latest available" echo '') - ]; + ] ++ update-cmds; environment.etc."pip.conf".text = '' [install] diff --git a/modules/flakes.nix b/modules/flakes.nix deleted file mode 100644 index 2009d55..0000000 --- a/modules/flakes.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, lib, ... }: -let - cfg = config.sconfig.flakes; -in -{ - options.sconfig.flakes = { - enable = lib.mkEnableOption "Enable Flakes"; - rebuildPath = lib.mkOption { - default = "/etc/nixos"; - type = lib.types.str; - description = "Flake to use when running nixos-rebuild helper scripts"; - }; - }; - - config = lib.mkIf cfg.enable { - - nix.package = pkgs.nixFlakes; - nix.extraOptions = '' - experimental-features = nix-command flakes - ''; - - environment.systemPackages = map - (x: (pkgs.writeShellScriptBin "sc-${x}" "nixos-rebuild ${x} --refresh --flake ${cfg.rebuildPath}")) - [ "switch" "build" "boot" ]; - - }; -}