Add home manager configuraiton

This commit is contained in:
Nathan McCarty 2024-11-28 02:25:07 +00:00
parent 92c095c8a5
commit 558ecfabd3
5 changed files with 90 additions and 26 deletions

View file

@ -85,6 +85,27 @@
"type": "github" "type": "github"
} }
}, },
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1732466619,
"narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f3111f62a23451114433888902a55cf0692b408d",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -204,6 +225,7 @@
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"home-manager": "home-manager",
"lix-module": "lix-module", "lix-module": "lix-module",
"nixos-wsl": "nixos-wsl", "nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",

View file

@ -10,6 +10,10 @@
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz"; url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-2.tar.gz";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
@ -21,6 +25,7 @@
# 2. Add foo as a parameter to the outputs function # 2. Add foo as a parameter to the outputs function
# 3. Add here: foo.flakeModule # 3. Add here: foo.flakeModule
./nixos/machines/wsl/configuration.nix ./nixos/machines/wsl/configuration.nix
./home-manager/machines/wsl/home.nix
]; ];
systems = [ systems = [
"x86_64-linux" "x86_64-linux"

View file

@ -0,0 +1,32 @@
{ withSystem, inputs, ... }:
{
# perSystem = { ... }: { config.packages.hello = ...; };
flake.homeConfigurations.wsl = withSystem "x86_64-linux" (
ctx@{ config, inputs', ... }:
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.${"x86_64-linux"};
extraSpecialArgs = {
inherit inputs inputs';
packages = config.packages;
};
modules = [
(
{
config,
lib,
pkgs,
...
}:
{
home.username = "nathan";
home.homeDirectory = "/home/nathan/";
programs.command-not-found.enable = true;
home.stateVersion = "24.11";
programs.home-manager.enable = true;
}
)
];
}
);
}

View file

@ -27,13 +27,16 @@
{ {
imports = [ imports = [
# WSL support # WSL support
inputs.nixos-wsl.nixosModules.default inputs.nixos-wsl.nixosModules.default
# Our modules # Our modules
(import ../../modules/base.nix {inherit inputs;}) (import ../../modules/base.nix { inherit inputs; })
(import ../../modules/user.nix {inherit inputs;mutableUsers = true;}) (import ../../modules/user.nix {
inherit inputs;
mutableUsers = true;
})
]; ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
wsl.enable = true; wsl.enable = true;
wsl.defaultUser = "nathan"; wsl.defaultUser = "nathan";
@ -42,13 +45,13 @@
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neovim neovim
git git
tmux tmux
nixfmt-rfc-style nixfmt-rfc-style
]; ];
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions # settings for stateful data, like file locations and database versions

View file

@ -12,19 +12,21 @@
}: }:
{ {
security.polkit = { enable = true; }; security.polkit = {
users = { enable = true;
inherit mutableUsers; };
users.${username} = { users = {
home = homedir; inherit mutableUsers;
description = "Nathan McCarty"; users.${username} = {
shell = pkgs.nushell; home = homedir;
isNormalUser = true; description = "Nathan McCarty";
extraGroups = [ shell = pkgs.nushell;
"wheel" isNormalUser = true;
]; extraGroups = [
hashedPassword = "$6$ShBAPGwzKZuB7eEv$cbb3erUqtVGFo/Vux9UwT2NkbVG9VGCxJxPiZFYL0DIc3t4GpYxjkM0M7fFnh.6V8MoSKLM/TvOtzdWbYwI58."; "wheel"
}; ];
hashedPassword = "$6$ShBAPGwzKZuB7eEv$cbb3erUqtVGFo/Vux9UwT2NkbVG9VGCxJxPiZFYL0DIc3t4GpYxjkM0M7fFnh.6V8MoSKLM/TvOtzdWbYwI58.";
};
}; };
} }