From fba9346c890cee78bbe57de3d0885139263ef8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sat, 2 Nov 2024 08:43:37 +0100 Subject: [PATCH] add home-manager to root --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 4 ++++ users/common/default.nix | 3 +++ users/default.nix | 1 + users/home-manager.nix | 26 ++++++++++++++++++++++++++ users/root/default.nix | 1 + 6 files changed, 56 insertions(+) create mode 100644 users/common/default.nix create mode 100644 users/home-manager.nix diff --git a/flake.lock b/flake.lock index be2e6089..6a362ae8 100644 --- a/flake.lock +++ b/flake.lock @@ -91,6 +91,26 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730490306, + "narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "1743615b61c7285976f85b303a36cdf88a556503", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "impermanence": { "locked": { "lastModified": 1729068498, @@ -290,6 +310,7 @@ "flake-utils": "flake-utils", "flakey-profile": "flakey-profile", "gitignore": "gitignore", + "home-manager": "home-manager", "impermanence": "impermanence", "lix": "lix", "lix-module": "lix-module", diff --git a/flake.nix b/flake.nix index e28a76dc..7d817503 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,10 @@ url = "github:hercules-ci/gitignore.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; impermanence = { url = "github:nix-community/impermanence"; }; diff --git a/users/common/default.nix b/users/common/default.nix new file mode 100644 index 00000000..06e725e4 --- /dev/null +++ b/users/common/default.nix @@ -0,0 +1,3 @@ +{...}: { + home.stateVersion = "24.11"; +} diff --git a/users/default.nix b/users/default.nix index 740d5576..2a2f998d 100644 --- a/users/default.nix +++ b/users/default.nix @@ -1,5 +1,6 @@ {...}: { imports = [ + ./home-manager.nix ./root ]; users.mutableUsers = false; diff --git a/users/home-manager.nix b/users/home-manager.nix new file mode 100644 index 00000000..da62cb35 --- /dev/null +++ b/users/home-manager.nix @@ -0,0 +1,26 @@ +{ + home-manager, + impermanence, + inputs, + inputs', + config, + ... +}: { + imports = [ + "${home-manager}/nixos" + ]; + home-manager = { + useUserPackages = true; + useGlobalPkgs = true; + backupFileExtension = "backup"; + extraSpecialArgs = + inputs + // { + inherit inputs inputs'; + systemConfig = config; + }; + sharedModules = [ + ./common + ]; + }; +} diff --git a/users/root/default.nix b/users/root/default.nix index 89638680..6fc761c9 100644 --- a/users/root/default.nix +++ b/users/root/default.nix @@ -14,4 +14,5 @@ directories = ["/root/.cache/nix"]; # for sanity files = ["/root/.bash_history"]; }; + home-manager.users.root = {}; }