diff options
author | Tim Keller <tjkeller.xyz> | 2024-10-02 22:54:57 -0500 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2024-10-02 22:54:57 -0500 |
commit | 2720ea4a2988b449de8aeedb4e173eb1f0900719 (patch) | |
tree | 1948dfb3131aba85c755819d16c8dfbb3019d487 | |
parent | 9d1b3f23a64506988608143f4bca8ab4c5141d3e (diff) | |
download | nixos-2720ea4a2988b449de8aeedb4e173eb1f0900719.tar.xz nixos-2720ea4a2988b449de8aeedb4e173eb1f0900719.zip |
userDetails added etc
-rw-r--r-- | flake.nix | 2 | ||||
-rw-r--r-- | modules/home/default.nix | 6 | ||||
-rw-r--r-- | modules/home/firefox.nix | 11 | ||||
-rw-r--r-- | modules/home/git.nix | 6 | ||||
-rw-r--r-- | modules/hosts/T430/configuration.nix | 17 | ||||
-rw-r--r-- | modules/root/default.nix | 1 | ||||
-rw-r--r-- | modules/root/doas.nix | 6 | ||||
-rw-r--r-- | modules/root/docker.nix | 4 | ||||
-rw-r--r-- | modules/root/normaluser.nix | 8 | ||||
-rw-r--r-- | modules/root/software.nix | 6 |
10 files changed, 32 insertions, 35 deletions
@@ -21,6 +21,8 @@ pkgs = nixpkgs.legacyPackages.${system}; userDetails = { username = "timmy"; + home.root = /home/timmy; + home.downloads = /home/timmy/dls; email = "tjkeller.xyz"; fullname = "Tim Keller"; }; diff --git a/modules/home/default.nix b/modules/home/default.nix index bce93ba..e60bbff 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,7 +1,7 @@ -{ lib, ... }: { +{ lib, userDetails, ... }: { home = { - username = "timmy"; - homeDirectory = "/home/timmy"; + username = userDetails.username; + homeDirectory = userDetails.home.root; stateVersion = "24.05"; }; diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix index 3ae1278..0977bbe 100644 --- a/modules/home/firefox.nix +++ b/modules/home/firefox.nix @@ -1,4 +1,4 @@ -{ +{ userDetails, ... }: { programs.firefox = { # TODO see if there is way to login to moz account in profile enable = true; @@ -28,7 +28,7 @@ "toolkit.legacyUserProfileCustomizations.stylesheets" = true; "browser.compactmode.show" = true; "browser.uidensity" = 1; # Compact - "browser.download.dir" = /home/timmy/dls; # FF will create this dir if it doesn't exist + "browser.download.dir" = userDetails.home.downloads; # FF will create this dir if it doesn't exist "browser.aboutConfig.showWarning" = false; # arkenfox does "app.normandy.first_run" = false; "browser.uiCustomization.state" = builtins.readFile ./resources/firefox/uiCustomization.json; # Toolbar etc. @@ -51,13 +51,6 @@ id = 1; inherit search; }; - Test = { - id = 2; - inherit search; - inherit arkenfox; - inherit userChrome; - inherit settings; - }; }; }; } diff --git a/modules/home/git.nix b/modules/home/git.nix index e1a36c3..9d15a90 100644 --- a/modules/home/git.nix +++ b/modules/home/git.nix @@ -1,7 +1,7 @@ -{ +{ userDetails, ... }: { programs.git = { enable = true; - userName = "Tim Keller"; # TODO set to user description - userEmail = "tjk@tjkeller.xyz"; # TODO set to user email + userName = userDetails.fullname; + userEmail = userDetails.email; }; } diff --git a/modules/hosts/T430/configuration.nix b/modules/hosts/T430/configuration.nix index a8744ba..282515d 100644 --- a/modules/hosts/T430/configuration.nix +++ b/modules/hosts/T430/configuration.nix @@ -2,20 +2,11 @@ imports = [ ./hardware-configuration.nix ]; networking.hostName = "T430"; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.timmy = { - description = "Tim Keller"; - isNormalUser = true; - extraGroups = [ "wheel" "docker" ]; # Enable ‘sudo’ for the user. - packages = with pkgs; [ - ]; - }; - # TODO this does not function - boot.initrd.systemd.extraBin = { - sh = "${pkgs.dash}/bin/dash"; - vim = "${pkgs.neovim}/bin/nvim"; - }; + #boot.initrd.systemd.extraBin = { + # sh = "${pkgs.dash}/bin/dash"; + # vim = "${pkgs.neovim}/bin/nvim"; + #}; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; diff --git a/modules/root/default.nix b/modules/root/default.nix index 05453b4..b03fab4 100644 --- a/modules/root/default.nix +++ b/modules/root/default.nix @@ -9,6 +9,7 @@ ./hosts.nix ./localization.nix ./nix.nix + ./normaluser.nix ./pipewire.nix ./software.nix ./virtualisation.nix diff --git a/modules/root/doas.nix b/modules/root/doas.nix index 2af324e..54cf63a 100644 --- a/modules/root/doas.nix +++ b/modules/root/doas.nix @@ -4,10 +4,10 @@ sudo.enable = lib.mkEnableOption "enables sudo"; }; - config = lib.mkIf config.doas.enable { - security.doas.enable = true; + config = { security.sudo.enable = config.sudo.enable; - security.doas.extraRules = [{ + security.doas.enable = config.doas.enable; + security.doas.extraRules = lib.mkIf config.doas.enable [{ groups = ["wheel"]; keepEnv = true; noPass = true; diff --git a/modules/root/docker.nix b/modules/root/docker.nix index d4b6272..2499699 100644 --- a/modules/root/docker.nix +++ b/modules/root/docker.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: { +{ pkgs, lib, config, userDetails, ... }: { options = { docker.enable = lib.mkEnableOption "enables docker"; docker.btrfsSupport = lib.mkEnableOption "changes docker storageDriver to btrfs"; @@ -13,5 +13,7 @@ environment.systemPackages = with pkgs; [ docker-compose ]; + + users.groups.docker.members = [ userDetails.username ]; }; } diff --git a/modules/root/normaluser.nix b/modules/root/normaluser.nix new file mode 100644 index 0000000..5d436e8 --- /dev/null +++ b/modules/root/normaluser.nix @@ -0,0 +1,8 @@ +{ userDetails, ... }: { + users.users.${userDetails.username} = { + description = userDetails.fullname; + home = userDetails.home.root; + isNormalUser = true; + extraGroups = [ "wheel" ]; + }; +} diff --git a/modules/root/software.nix b/modules/root/software.nix index c991456..4aa6f64 100644 --- a/modules/root/software.nix +++ b/modules/root/software.nix @@ -80,11 +80,11 @@ ]; # More desktop - programs.dconf.enable = lib.mkIf config.software.desktop.enable true; # For home-manager to configure gtk TODO this should be there instead + programs.dconf.enable = config.software.desktop.enable; # For home-manager to configure gtk TODO this should be there instead # More utilities - programs.zsh.enable = lib.mkIf config.software.utils.enable true; + programs.zsh.enable = config.software.utils.enable; users.defaultUserShell = lib.mkIf config.software.utils.enable pkgs.zsh; - services.openssh.enable = lib.mkIf config.software.utils.enable true; + services.openssh.enable = config.software.utils.enable; }; } |