From c166dfdb1091515116a0eb082626f9b6905a9f7a Mon Sep 17 00:00:00 2001 From: Sk7Str1p3 Date: Sun, 3 May 2026 15:43:27 +0300 Subject: [PATCH] feat(users): init `home-manager` --- flake.lock | 45 +++++++++++++++++++++++++---- flake.nix | 1 + flake/inputs/default.nix | 2 +- flake/inputs/home.nix | 14 +++++++++ users/Sk7Str1p3/modules/default.nix | 1 + users/default.nix | 15 ++++++++++ 6 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 flake/inputs/home.nix create mode 100644 users/Sk7Str1p3/modules/default.nix diff --git a/flake.lock b/flake.lock index 75fb5ec..450f8aa 100644 --- a/flake.lock +++ b/flake.lock @@ -33,13 +33,31 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1777780644, + "narHash": "sha256-CYpc+mk28rmcQWGygeM8CA+Z8SZYy8BOyQtiW18spao=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "b9311028044a9e9b2cf27db15ef0a87d464e212d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1773389992, - "narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=", + "lastModified": 1777268161, + "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c06b4ae3d6599a672a6210b7021d699c351eebda", + "rev": "1c3fe55ad329cbcb28471bb30f05c9827f724c76", "type": "github" }, "original": { @@ -65,6 +83,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1773389992, + "narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c06b4ae3d6599a672a6210b7021d699c351eebda", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1775888245, "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", @@ -84,13 +118,14 @@ "inputs": { "flake-file": "flake-file", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs", + "home-manager": "home-manager", + "nixpkgs": "nixpkgs_2", "sops-nix": "sops-nix" } }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1777338324, diff --git a/flake.nix b/flake.nix index a6765ac..9b58f96 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,7 @@ inputs = { flake-file.url = "github:vic/flake-file"; flake-parts.url = "github:hercules-ci/flake-parts"; + home-manager.url = "github:nix-community/home-manager"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; sops-nix.url = "github:mic92/sops-nix"; }; diff --git a/flake/inputs/default.nix b/flake/inputs/default.nix index f65279f..8d10537 100644 --- a/flake/inputs/default.nix +++ b/flake/inputs/default.nix @@ -14,4 +14,4 @@ > Then accessing inputs in repl, remove {class}, so instead of calling e.g. `flake.inputs.core.nixpkgs`, > you call `flake.inputs.nixpkgs`. */ -import ./core.nix +(import ./core.nix) // (import ./home.nix) diff --git a/flake/inputs/home.nix b/flake/inputs/home.nix new file mode 100644 index 0000000..bb96a3b --- /dev/null +++ b/flake/inputs/home.nix @@ -0,0 +1,14 @@ +# Home inputs + +/** + Inputs providing modules or packages for user configuration. +*/ +{ + /** + System for managing a user environment. + Allows declarative configuration of user specific (non-global) packages and dotfiles. + */ + home-manager = { + url = "github:nix-community/home-manager"; + }; +} diff --git a/users/Sk7Str1p3/modules/default.nix b/users/Sk7Str1p3/modules/default.nix new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/users/Sk7Str1p3/modules/default.nix @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/users/default.nix b/users/default.nix index 0cf4c51..a3e282f 100644 --- a/users/default.nix +++ b/users/default.nix @@ -54,4 +54,19 @@ }; }) cfg.usersList ); + + # Configurure home-manager + home-manager = { + backupFileExtension = "backup-${builtins.currentTime}"; + + users = lib.mkMerge ( + map (user: { + ${user} = { + imports = [ + ./${user}/modules + ]; + } + }) cfg.usersList + ) + }; }