diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index 588c8ee..02fb877 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -62,6 +62,7 @@ ./roles/sm64ex ./roles/shipwright ./roles/2ship2harkinian + ./roles/nix_index ]; nix.settings.experimental-features = [ @@ -147,7 +148,6 @@ trace-cmd # ftrace tcpdump git-crypt - nix-index-unwrapped gnumake ncdu nix-tree diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index b04cc69..dff0346 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -47,6 +47,7 @@ me.launch_keyboard.enable = true; me.lvfs.enable = true; me.media.enable = true; + me.nix_index.enable = true; me.python.enable = true; me.qemu.enable = true; me.rust.enable = true; diff --git a/nix/configuration/roles/nix_index/default.nix b/nix/configuration/roles/nix_index/default.nix new file mode 100644 index 0000000..81f392e --- /dev/null +++ b/nix/configuration/roles/nix_index/default.nix @@ -0,0 +1,44 @@ +{ + config, + lib, + pkgs, + ... +}: + +{ + imports = [ ]; + + options.me = { + nix_index.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install nix_index."; + }; + }; + + config = lib.mkIf config.me.nix_index.enable ( + lib.mkMerge [ + { + environment.systemPackages = with pkgs; [ + nix-index-unwrapped + ]; + + environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + users.talexander = { + directories = [ + { + directory = ".cache/nix-index"; + user = "talexander"; + group = "talexander"; + mode = "0755"; + } + ]; + }; + }; + + } + ] + ); +}