project: add home-manager config

This commit is contained in:
Gabriel Arazas 2023-11-08 21:16:55 +08:00
parent 8938c60ce7
commit d862b90209
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 56 additions and 14 deletions

21
flake.lock generated
View File

@ -1,5 +1,25 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1699368917,
"narHash": "sha256-nUtGIWf86BOkUbtksWtfglvCZ/otP0FTZlQH8Rzc7PA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6a8444467c83c961e2f5ff64fb4f422e303c98d3",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1699099776,
@ -50,6 +70,7 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable"

View File

@ -5,27 +5,42 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ nixpkgs, ... }: {
outputs = inputs@{ nixpkgs, home-manager, ... }: let
system = "x86_64-linux";
nixSettings = { config, lib, pkgs, ... }: {
# Setting each of the flake inputs as part of the system registry
# including our own flake which is just renamed from "self" to
# "config".
nix.registry =
lib.mapAttrs'
(name: flake:
let
name' = if (name == "self") then "config" else name;
in
lib.nameValuePair name' { inherit flake; })
inputs;
};
in
{
nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({ config, lib, pkgs, ... }: {
# Setting each of the flake inputs as part of the system registry
# including our own flake which is just renamed from "self" to
# "config".
nix.registry =
lib.mapAttrs'
(name: flake:
let
name' = if (name == "self") then "config" else name;
in
lib.nameValuePair name' { inherit flake; })
inputs;
})
nixSettings
./hosts/desktop
];
};
homeConfigurations.foodogsquared = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
modules = [
nixSettings
./users/foodogsquared
];
};
};
}

View File

@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }:
{
programs.home-manager.enable = true;
home.stateVersion = "23.11";
}