add flakes to all systems

This commit is contained in:
Sean Buckley 2021-05-28 16:16:28 -04:00
parent 485c8f899a
commit 3a08df0cc7
6 changed files with 10 additions and 35 deletions

View file

@ -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

View file

@ -5,7 +5,6 @@
outputs = { self, unstable, stable2009 }: {
nixosModule = { ... }: {
imports = [ ./. ];
config = { sconfig.flakes.enable = true; };
};
nixosConfigurations = import ./hosts { modules = [ ./. ]; inherit unstable stable2009; };
};

View file

@ -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; })
];
}
)

View file

@ -25,6 +25,10 @@
nix = {
daemonNiceLevel = 19;
daemonIONiceLevel = 7;
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
hardware = {

View file

@ -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]

View file

@ -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" ];
};
}