move stuff into common config

This commit is contained in:
uku 2024-02-14 15:59:20 +01:00
parent 1c50282114
commit 71312d55b9
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
5 changed files with 34 additions and 61 deletions

View file

@ -5,7 +5,18 @@
nixpkgs,
agenix,
...
}: {
}: let
username = "leo";
stateVersion = "23.11";
in {
imports = [
(lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username])
../programs/fish.nix
../programs/git.nix
../programs/starship
];
age = {
identityPaths = ["/etc/age/key"];
@ -39,6 +50,10 @@
};
};
hm.home = {
inherit stateVersion;
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
@ -109,7 +124,19 @@
time.timeZone = "Europe/Paris";
users.users.root.hashedPasswordFile = config.age.secrets.rootPassword.path;
users.users = {
"${username}" = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = ["networkmanager" "wheel" "video" "libvirtd"];
hashedPasswordFile = config.age.secrets.userPassword.path;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN+7+KfdOrhcnHayxvOENUeMx8rE4XEIV/AxMHiaNUP8"
];
};
root.hashedPasswordFile = config.age.secrets.rootPassword.path;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
@ -117,5 +144,5 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = lib.mkDefault "23.11"; # Did you read the comment?
system.stateVersion = lib.mkDefault stateVersion; # Did you read the comment?
}

View file

@ -1,30 +0,0 @@
{
lib,
pkgs,
config,
...
}: let
username = "uku";
in {
imports = [
(lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username])
../programs/fish.nix
../programs/git.nix
../programs/starship
];
hm.home.stateVersion = "23.11";
services.tailscale.extraUpFlags = ["--advertise-exit-node"];
users.users."${username}" = {
isNormalUser = true;
shell = pkgs.fish;
extraGroups = ["networkmanager" "wheel"];
hashedPasswordFile = config.age.secrets.userPassword.path;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN+7+KfdOrhcnHayxvOENUeMx8rE4XEIV/AxMHiaNUP8"
];
};
}