feat: add home-manager for user

This commit is contained in:
Michael Mandl 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": {
"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"
}
}
},

View file

@ -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 ];
};
}
];
};
};

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;
}