feat: add home-manager for user

main
mandlm 2022-06-18 19:48:25 +02:00
parent fba5beeabf
commit c1ae7008fe
3 changed files with 45 additions and 6 deletions

View File

@ -23,16 +23,32 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1655470064, "lastModified": 1655456688,
"narHash": "sha256-sELkMX4YGAoH78ci1mCBpW0ZSjqEMVzs9kSQz4gRAJs=", "narHash": "sha256-j2trI5gv2fnHdfUQFBy957avCPxxzCqE8R+TOYHPSRE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f919a40e544da31a3b4b42e87cf30a5078c2b09c", "rev": "d17a56d90ecbd1b8fc908d49598fb854ef188461",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "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", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -40,7 +56,8 @@
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
} }
} }
}, },

View File

@ -1,6 +1,7 @@
{ {
inputs = { 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 = { home-manager = {
url = github:nix-community/home-manager/release-22.05; url = github:nix-community/home-manager/release-22.05;
@ -23,6 +24,7 @@
./machines/nixos-vm/hardware-configuration.nix ./machines/nixos-vm/hardware-configuration.nix
]; ];
}; };
nixosConfigurations.apache = nixpkgs.lib.nixosSystem { nixosConfigurations.apache = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = inputs; specialArgs = inputs;
@ -31,6 +33,15 @@
./users.nix ./users.nix
./machines/apache/configuration.nix ./machines/apache/configuration.nix
./machines/apache/hardware-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 ];
};
}
]; ];
}; };
}; };

11
home-mandlm.nix Normal file
View File

@ -0,0 +1,11 @@
{ config, lib, pkgs, user, ...}:
{
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "22.05";
};
programs.home-manager.enable = true;
}