Let each host define the homedir instead of one global one in the flake

pull/50/head
Tudor Roman 2024-01-07 19:24:46 +02:00
parent f20df09855
commit 5e6361b9b5
Signed by: tudor
SSH Key Fingerprint: SHA256:3CwS9plgXBecpXImPGxDIaSktUXBejbV/zerZMqzzBk
7 changed files with 27 additions and 17 deletions

View File

@ -18,7 +18,7 @@
- name: Copy session file
become: true
ansible.builtin.copy:
src: sway.desktop
ansible.builtin.template:
src: sway.desktop.j2
dest: /usr/local/share/wayland-sessions/sway.desktop
mode: "0444"

View File

@ -1,5 +1,5 @@
[Desktop Entry]
Name=sway
Exec=/home/tudor/.nix-profile/bin/sway
Exec=/home/{{ lookup('env', 'USER') }}/.nix-profile/bin/sway
Type=Application
DesktopNames=sway

View File

@ -69,7 +69,6 @@
let
vars = {
stateVersion = "23.11";
username = "tudor";
};
specialArgs = {

View File

@ -29,12 +29,6 @@
};
users.mutableUsers = false;
users.users.${vars.username} = {
isNormalUser = true;
extraGroups = [ "wheel" "scanner" "lp" ];
uid = 1000;
home = "/home/${vars.username}";
};
system.stateVersion = vars.stateVersion;
system.configurationRevision = flake.self.rev or "dirty";

View File

@ -48,7 +48,11 @@
dedyn.file = ../../secrets/ceres/dedyn.age;
};
users.users.${vars.username} = {
users.users.tudor = {
isNormalUser = true;
extraGroups = [ "wheel" ];
uid = 1000;
home = "/home/tudor";
hashedPasswordFile = config.age.secrets.tudor-password.path;
openssh.authorizedKeys.keys = [
(builtins.readFile ../../id_ed25519.pub)

View File

@ -1,5 +1,7 @@
{ config, flake, vars, ... }:
{
let
username = "tudor";
in {
imports = [ ../_all flake.inputs.nixos-wsl.nixosModules.wsl ];
systemModules = {
@ -15,7 +17,7 @@
wsl = {
enable = true;
wslConf.automount.root = "/mnt";
defaultUser = vars.username;
defaultUser = username;
startMenuLaunchers = true;
nativeSystemd = true;
};
@ -26,7 +28,13 @@
file = ../../secrets/wsl2/tudor-password.age;
};
users.users.${vars.username}.hashedPasswordFile = config.age.secrets.tudor-password.path;
users.users."${username}" = {
isNormalUser = true;
extraGroups = [ "wheel" ];
uid = 1000;
home = "/home/${username}";
hashedPasswordFile = config.age.secrets.tudor-password.path;
};
home-manager.users.tudor = ../../users + "/tudor@wsl2";
}

View File

@ -3,7 +3,6 @@ let
cfg = config.systemModules.services.web.cgit;
readmeFile = ./cgit-root-readme.md;
logoFile = ./logo.png;
repoDir = "/home/${vars.username}/git/";
configFile = pkgs.writeText "cgitrc" ''
css=/cgit.css
logo=/logo.png
@ -32,11 +31,17 @@ let
snapshots=tar.gz zip
section-from-path=1
scan-path=${repoDir}
scan-path=${if cfg.repoDir == "" then throw "Repodir must be set" else cfg.repoDir}
'';
in
with lib; {
options.systemModules.services.web.cgit.enable = mkEnableOption "cgit";
options.systemModules.services.web.cgit = {
enable = mkEnableOption "cgit";
repoDir = mkOption {
type = types.str;
default = "";
};
};
config = mkIf cfg.enable {
services.fcgiwrap.enable = true;