add home manager as a flake

This commit is contained in:
Pim Kunis 2023-10-08 18:03:14 +02:00
parent 7f900c6be3
commit 747d2bd03f
4 changed files with 31 additions and 5 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
result

View file

@ -29,7 +29,7 @@ in
excludePackages = with pkgs; [ xterm ]; excludePackages = with pkgs; [ xterm ];
}; };
home-manager.users.pim = import ./home/home.nix; # home-manager.users.pim = import ./home/home.nix;
users.users.pim = { users.users.pim = {
isNormalUser = true; isNormalUser = true;

View file

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=",
"type": "tarball",
"url": "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1696697597, "lastModified": 1696697597,
@ -18,6 +34,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -3,9 +3,13 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
home-manager = {
url = "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs }: outputs = { self, nixpkgs, home-manager }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
@ -18,10 +22,16 @@
{ {
nixosConfigurations = { nixosConfigurations = {
myNixos = nixpkgs.lib.nixosSystem { myNixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit system; }; inherit system;
modules = [ modules = [
./configuration.nix ./configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.pim = {
imports = [ ./home/home.nix ];
};
}
]; ];
}; };
}; };