From c1ae7008fe5d90a9b332ebe7be95ae0ba4c4c57b Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Sat, 18 Jun 2022 19:48:25 +0200 Subject: [PATCH] feat: add home-manager for user --- flake.lock | 27 ++++++++++++++++++++++----- flake.nix | 13 ++++++++++++- home-mandlm.nix | 11 +++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 home-mandlm.nix diff --git a/flake.lock b/flake.lock index b3e026b..72ab0f1 100644 --- a/flake.lock +++ b/flake.lock @@ -23,16 +23,32 @@ }, "nixpkgs": { "locked": { - "lastModified": 1655470064, - "narHash": "sha256-sELkMX4YGAoH78ci1mCBpW0ZSjqEMVzs9kSQz4gRAJs=", + "lastModified": 1655456688, + "narHash": "sha256-j2trI5gv2fnHdfUQFBy957avCPxxzCqE8R+TOYHPSRE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f919a40e544da31a3b4b42e87cf30a5078c2b09c", + "rev": "d17a56d90ecbd1b8fc908d49598fb854ef188461", "type": "github" }, "original": { "owner": "NixOS", - "ref": "release-22.05", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1655400192, + "narHash": "sha256-49OBVVRgb9H/PSmNT9W61+NRdDbuSJVuDDflwXlaUKU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3d7435c638baffaa826b85459df0fff47f12317d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -40,7 +56,8 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 4ab4a08..c2c1103 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { - nixpkgs.url = github:NixOS/nixpkgs/release-22.05; + nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05; + nixpkgs-unstable.url = github:NixOS/nixpkgs/nixos-unstable; home-manager = { url = github:nix-community/home-manager/release-22.05; @@ -23,6 +24,7 @@ ./machines/nixos-vm/hardware-configuration.nix ]; }; + nixosConfigurations.apache = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = inputs; @@ -31,6 +33,15 @@ ./users.nix ./machines/apache/configuration.nix ./machines/apache/hardware-configuration.nix + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = { inherit user; }; + home-manager.users.${user} = { + imports = [ ./home-${user}.nix ]; + }; + } ]; }; }; diff --git a/home-mandlm.nix b/home-mandlm.nix new file mode 100644 index 0000000..857ecef --- /dev/null +++ b/home-mandlm.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, user, ...}: + +{ + home = { + username = "${user}"; + homeDirectory = "/home/${user}"; + stateVersion = "22.05"; + }; + + programs.home-manager.enable = true; +}