feat: manage user configuration with Home Manager
This commit is contained in:
parent
7ae4243548
commit
07f806604f
5 changed files with 66 additions and 2 deletions
22
flake.lock
generated
22
flake.lock
generated
|
|
@ -16,6 +16,27 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1790996401,
|
||||||
|
"narHash": "sha256-f+kOxEmOUnQazVAmGg0i8hzwgd1kX/geY+k/Dpheye8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "db7d5e2332710f5abb088f6b5de927d7f9511b35",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-26.05",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1790920529,
|
"lastModified": 1790920529,
|
||||||
|
|
@ -35,6 +56,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"codex-nixpkgs": "codex-nixpkgs",
|
"codex-nixpkgs": "codex-nixpkgs",
|
||||||
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
flake.nix
11
flake.nix
|
|
@ -4,12 +4,19 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||||
codex-nixpkgs.url = "github:NixOS/nixpkgs/master";
|
codex-nixpkgs.url = "github:NixOS/nixpkgs/master";
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/release-26.05";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, codex-nixpkgs, ... }: {
|
outputs = { nixpkgs, codex-nixpkgs, home-manager, ... }: {
|
||||||
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [ ./nixos/hosts/nixos ];
|
modules = [
|
||||||
|
./nixos/hosts/nixos
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
codexPkgs = codex-nixpkgs.legacyPackages.x86_64-linux;
|
codexPkgs = codex-nixpkgs.legacyPackages.x86_64-linux;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
24
nixos/home/hhhh.nix
Normal file
24
nixos/home/hhhh.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
repo = "${config.home.homeDirectory}/Git/Custom-environment";
|
||||||
|
configDirs = [
|
||||||
|
"atuin"
|
||||||
|
"gitui"
|
||||||
|
"hypr"
|
||||||
|
"kitty"
|
||||||
|
"mako"
|
||||||
|
"nvim"
|
||||||
|
"waybar"
|
||||||
|
"wofi"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Keep this at the version used when first enabling Home Manager.
|
||||||
|
home.stateVersion = "26.05";
|
||||||
|
|
||||||
|
xdg.enable = true;
|
||||||
|
xdg.configFile = lib.genAttrs configDirs (name: {
|
||||||
|
source = config.lib.file.mkOutOfStoreSymlink "${repo}/${name}";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../modules/desktop.nix
|
../../modules/desktop.nix
|
||||||
../../modules/hardware.nix
|
../../modules/hardware.nix
|
||||||
|
../../modules/home.nix
|
||||||
../../modules/login-theme.nix
|
../../modules/login-theme.nix
|
||||||
../../modules/packages
|
../../modules/packages
|
||||||
../../modules/system.nix
|
../../modules/system.nix
|
||||||
|
|
|
||||||
10
nixos/modules/home.nix
Normal file
10
nixos/modules/home.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
home-manager = {
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
backupFileExtension = "hm-backup";
|
||||||
|
users.hhhh = import ../home/hhhh.nix;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue