Switching from hardcoded username.

Will this ever change? No like likely, but I do think that this is the
correct way to do this.
This commit is contained in:
James Patrick 2022-08-14 19:35:15 -04:00
parent 8030f530ce
commit d7e2c0a924
29 changed files with 132 additions and 106 deletions

View File

@ -58,7 +58,10 @@
channelsConfig = { allowUnfree = true; }; channelsConfig = { allowUnfree = true; };
sharedOverlays = [ nur.overlay (import ./pkgs) emacs-overlay.overlay ]; sharedOverlays = [ nur.overlay (import ./pkgs) emacs-overlay.overlay ];
hostDefaults = { hostDefaults = {
specialArgs = { inherit home-manager nixos-hardware; }; specialArgs = {
inherit home-manager nixos-hardware;
user = { name = "james"; description = "James Patrick"; };
};
modules = mapModulesRec' ./modules import; modules = mapModulesRec' ./modules import;
system = "x86_64-linux"; system = "x86_64-linux";
}; };

View File

@ -1,9 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.onepassword; this = config.my.application.onepassword;
graphical = config.my.graphical; graphical = config.my.graphical;
enable = (this.gui.enable || this.cli.enable); enable = (this.gui.enable || this.cli.enable);
in with lib; { in
with lib; {
options = { options = {
my.application.onepassword.gui.enable = mkOption { my.application.onepassword.gui.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -17,10 +18,10 @@ in with lib; {
config = mkIf enable (mkMerge [ config = mkIf enable (mkMerge [
(mkIf this.cli.enable { (mkIf this.cli.enable {
home-manager.users.james.home.packages = with pkgs; [ _1password ]; home-manager.users."${user.name}".home.packages = with pkgs; [ _1password ];
}) })
(mkIf this.gui.enable { (mkIf this.gui.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ _1password-gui ]; home.packages = with pkgs; [ _1password-gui ];
}; };
systemd.user.services._1password = { systemd.user.services._1password = {

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.blueman; this = config.my.application.blueman;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.blueman.enable = mkOption { my.application.blueman.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -12,7 +13,7 @@ in with lib; {
config = mkIf this.enable { config = mkIf this.enable {
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
home-manager.users.james = { home.packages = with pkgs; [ blueman ]; }; home-manager.users."${user.name}" = { home.packages = with pkgs; [ blueman ]; };
fileSystems."var/lib/bluetooth" = { fileSystems."var/lib/bluetooth" = {
device = "/persist/var/lib/bluetooth"; device = "/persist/var/lib/bluetooth";
options = [ "bind" "noauto" "x-systemd.automount" ]; options = [ "bind" "noauto" "x-systemd.automount" ];

View File

@ -1,9 +1,10 @@
{ options, config, lib, pkgs, ... }: { options, config, lib, pkgs, user, ... }:
let let
this = config.my.application.dunst; this = config.my.application.dunst;
i3 = config.my.application.i3; i3 = config.my.application.i3;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.dunst.enable = mkOption { my.application.dunst.enable = mkOption {
default = i3.enable; default = i3.enable;
@ -12,7 +13,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
systemd.user.startServices = true; systemd.user.startServices = true;
services.dunst.enable = true; services.dunst.enable = true;
home.packages = with pkgs; [ libnotify ]; home.packages = with pkgs; [ libnotify ];

View File

@ -1,10 +1,11 @@
{ inputs, config, lib, pkgs, ... }: { inputs, config, lib, pkgs, user, ... }:
# TODO Still need the following dependecies # TODO Still need the following dependecies
# - Language tools (grammer) # - Language tools (grammer)
let let
this = config.my.application.emacs; this = config.my.application.emacs;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.emacs.enable = mkOption { my.application.emacs.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -14,7 +15,7 @@ in with lib; {
config = mkIf this.enable { config = mkIf this.enable {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ]; nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
home-manager.users.james = { home-manager.users."${user.name}" = {
programs.emacs = { programs.emacs = {
package = pkgs.emacs28NativeComp; package = pkgs.emacs28NativeComp;
enable = true; enable = true;

View File

@ -1,8 +1,9 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, user, ... }:
let let
cfg = config.my.application.firefox; cfg = config.my.application.firefox;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options.my.application.firefox = { options.my.application.firefox = {
enable = mkOption { enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -18,7 +19,7 @@ in with lib; {
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.sessionVariables = { MOZ_USE_XINPUT2 = "1"; }; environment.sessionVariables = { MOZ_USE_XINPUT2 = "1"; };
home-manager.users.james = { home-manager.users."${user.name}" = {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = cfg.pkg; package = cfg.pkg;

View File

@ -1,8 +1,9 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, user, ... }:
let let
this = config.my.application.firefox.tridactyl; this = config.my.application.firefox.tridactyl;
firefox = config.my.application.firefox; firefox = config.my.application.firefox;
in with lib; { in
with lib; {
options = { options = {
my.application.firefox.tridactyl.enable = mkOption { my.application.firefox.tridactyl.enable = mkOption {
default = firefox.enable; default = firefox.enable;
@ -14,7 +15,7 @@ in with lib; {
config = mkIf this.enable { config = mkIf this.enable {
# firefox.pkg = # firefox.pkg =
# pkgs.firefox.override { this = { enableTridactylNative = true; }; }; # pkgs.firefox.override { this = { enableTridactylNative = true; }; };
home-manager.users.james = { home-manager.users."${user.name}" = {
programs.firefox = { programs.firefox = {
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ tridactyl ]; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ tridactyl ];
}; };

View File

@ -1,8 +1,9 @@
{ options, config, lib, pkgs, ... }: { options, config, lib, pkgs, user, ... }:
let let
this = config.my.application.gammastep; this = config.my.application.gammastep;
i3 = config.my.application.i3; i3 = config.my.application.i3;
in with lib; { in
with lib; {
options = { options = {
my.application.gammastep.enable = mkOption { my.application.gammastep.enable = mkOption {
default = i3.enable; default = i3.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
services.gammastep = { services.gammastep = {
enable = true; enable = true;
provider = "geoclue2"; provider = "geoclue2";

View File

@ -1,13 +1,14 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
graphical = config.my.graphical; graphical = config.my.graphical;
power = config.my.system.power; power = config.my.system.power;
keyring = config.my.system.keyring; keyring = config.my.system.keyring;
in with lib; { in
with lib; {
config = mkIf graphical.enable { config = mkIf graphical.enable {
services.gvfs.enable = true; services.gvfs.enable = true;
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs.gnome; home.packages = with pkgs.gnome;
[ [
cheese cheese

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.i3; this = config.my.application.i3;
graphical = config.my.graphical; graphical = config.my.graphical;
@ -8,7 +8,8 @@ let
sha256 = "sha256-dErBslKRBTLKbTTUanIPDwX8CcMJ0Kpi3oof0oXlHys="; sha256 = "sha256-dErBslKRBTLKbTTUanIPDwX8CcMJ0Kpi3oof0oXlHys=";
}; };
in with lib; { in
with lib; {
options = { options = {
my.application.i3.enable = mkOption { my.application.i3.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -55,7 +56,7 @@ in with lib; {
}; };
}; };
home-manager.users.james = { home-manager.users."${user.name}" = {
xsession.windowManager.i3 = { xsession.windowManager.i3 = {
enable = true; enable = true;
package = pkgs.i3-gaps; package = pkgs.i3-gaps;
@ -170,6 +171,6 @@ in with lib; {
}; };
}; };
users.users.james.extraGroups = [ "video" "audio" ]; users.users."${user.name}".extraGroups = [ "video" "audio" ];
}; };
} }

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.i3.polybar; this = config.my.application.i3.polybar;
i3 = config.my.application.i3; i3 = config.my.application.i3;
@ -11,7 +11,8 @@ let
primary = "#F0C674"; primary = "#F0C674";
secondary = "#8ABEB7"; secondary = "#8ABEB7";
}; };
in with lib; { in
with lib; {
options = { options = {
my.application.i3.polybar.enable = mkOption { my.application.i3.polybar.enable = mkOption {
default = i3.enable; default = i3.enable;
@ -20,7 +21,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
services.polybar = { services.polybar = {
enable = true; enable = true;
script = "polybar"; script = "polybar";

View File

@ -1,9 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.i3.rofi; this = config.my.application.i3.rofi;
i3 = config.my.application.i3; i3 = config.my.application.i3;
in with lib; { in
with lib; {
options = { options = {
my.application.i3.rofi.enable = mkOption { my.application.i3.rofi.enable = mkOption {
default = i3.enable; default = i3.enable;
@ -12,7 +13,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ rofi-systemd rofi-power-menu ]; home.packages = with pkgs; [ rofi-systemd rofi-power-menu ];
programs.rofi = { programs.rofi = {
enable = true; enable = true;

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.kdeconnect; this = config.my.application.kdeconnect;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.kdeconnect.enable = mkOption { my.application.kdeconnect.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
# home-manager.users.james = { # home-manager.users."${user.name}" = {
# services.kdeconnect = { # services.kdeconnect = {
# indicator = true; # indicator = true;
# enable = true; # enable = true;

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.kitty; this = config.my.application.kitty;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.kitty.enable = mkOption { my.application.kitty.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ kitty ]; home.packages = with pkgs; [ kitty ];
programs.kitty = { programs.kitty = {
enable = true; enable = true;

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.media; this = config.my.application.media;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.media.enable = mkOption { my.application.media.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
programs.mpv = { programs.mpv = {
enable = true; enable = true;
scripts = with pkgs.mpvScripts; [ mpris thumbnail ]; scripts = with pkgs.mpvScripts; [ mpris thumbnail ];

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.nextcloud; this = config.my.application.nextcloud;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.nextcloud.enable = mkOption { my.application.nextcloud.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ nextcloud-client ]; home.packages = with pkgs; [ nextcloud-client ];
}; };

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.spotify; this = config.my.application.spotify;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.spotify.enable = mkOption { my.application.spotify.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home.packages = with pkgs; [ spotify ]; }; home-manager.users."${user.name}" = { home.packages = with pkgs; [ spotify ]; };
# Local discovery - https://nixos.wiki/wiki/Spotify # Local discovery - https://nixos.wiki/wiki/Spotify
networking.firewall.allowedTCPPorts = [ 57621 ]; networking.firewall.allowedTCPPorts = [ 57621 ];

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.zathura; this = config.my.application.zathura;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.zathura.enable = mkOption { my.application.zathura.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,6 +12,6 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { programs.zathura = { enable = true; }; }; home-manager.users."${user.name}" = { programs.zathura = { enable = true; }; };
}; };
} }

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.application.zeal; this = config.my.application.zeal;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.application.zeal.enable = mkOption { my.application.zeal.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,6 +12,6 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james.home.packages = with pkgs; [ zeal ]; home-manager.users."${user.name}".home.packages = with pkgs; [ zeal ];
}; };
} }

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.lang.bash; this = config.my.lang.bash;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.lang.bash.enable = mkOption { my.lang.bash.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ home.packages = with pkgs; [
nodePackages.bash-language-server nodePackages.bash-language-server
shellcheck shellcheck

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.lang.golang; this = config.my.lang.golang;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.lang.golang.enable = mkOption { my.lang.golang.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
programs.go = { programs.go = {
enable = true; enable = true;
goPath = ".local/go"; goPath = ".local/go";

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.lang.bash; this = config.my.lang.bash;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options = { options = {
my.lang.javascript.enable = mkOption { my.lang.javascript.enable = mkOption {
default = graphical.enable; default = graphical.enable;
@ -11,7 +12,7 @@ in with lib; {
}; };
config = mkIf this.enable { config = mkIf this.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ home.packages = with pkgs; [
nodePackages.npm nodePackages.npm
nodePackages.vue-cli nodePackages.vue-cli

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let graphical = config.my.graphical; let graphical = config.my.graphical;
in with lib; { in
with lib; {
config = mkIf graphical.enable { config = mkIf graphical.enable {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ dracula-theme kora-icon-theme ]; home.packages = with pkgs; [ dracula-theme kora-icon-theme ];
home.sessionVariables = { GTK_THEME = "Dracula"; }; home.sessionVariables = { GTK_THEME = "Dracula"; };
systemd.user.sessionVariables = { GTK_THEME = "Dracula"; }; systemd.user.sessionVariables = { GTK_THEME = "Dracula"; };

View File

@ -1,18 +1,9 @@
{ config, home-manager, lib, pkgs, ... }: { { config, home-manager, lib, pkgs, user, ... }: {
imports = [ home-manager.nixosModules.home-manager ]; imports = [ home-manager.nixosModules.home-manager ];
home-manager.useGlobalPkgs = true; home-manager = {
home-manager.useUserPackages = true; useGlobalPkgs = true;
home-manager.users.james = { useUserPackages = true;
# Home Manager needs a bit of information about you and the users."${user.name}" = {
# paths it should manage.
home.username = "james";
home.homeDirectory = "/home/james";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See # You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version # the Home Manager release notes for a list of state version
# changes in each release. # changes in each release.
@ -21,4 +12,5 @@
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
}; };
};
} }

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
#with lib.my; #with lib.my;
with lib; with lib;
let let
@ -7,7 +7,8 @@ let
url = "https://github.com/jamesepatrick.keys"; url = "https://github.com/jamesepatrick.keys";
sha256 = "sha256-alm6KRFca4VjzTyVEg+j1s0uKaSfvV76o3sgYNAisSA="; sha256 = "sha256-alm6KRFca4VjzTyVEg+j1s0uKaSfvV76o3sgYNAisSA=";
}; };
in { in
{
options.my = { options.my = {
system.ssh.enable = mkOption { system.ssh.enable = mkOption {
default = true; default = true;
@ -23,6 +24,6 @@ in {
passwordAuthentication = false; passwordAuthentication = false;
}; };
users.users.james.openssh.authorizedKeys.keyFiles = [ publicKey ]; users.users."${user.name}".openssh.authorizedKeys.keyFiles = [ publicKey ];
}; };
} }

View File

@ -1,13 +1,19 @@
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
{ config, lib, pkgs, ... }: { { config, lib, pkgs, user, ... }: {
users.users = { users.users = {
root.initialPassword = "noreallychangemenow"; root.initialPassword = "noreallychangemenow";
james = {
description = "James Patrick"; "${user.name}" = {
description = "${user.description}";
extraGroups = [ "wheel" "systemd-journal" ]; extraGroups = [ "wheel" "systemd-journal" ];
initialPassword = "nixos"; initialPassword = "nixos";
isNormalUser = true; isNormalUser = true;
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
}; };
home-manager.users."${user.name}".home = {
username = "${user.name}";
homeDirectory = "/home/${user.name}";
};
} }

View File

@ -1,5 +1,5 @@
{ config, pkgs, ... }: { { config, pkgs, user, ... }: {
home-manager.users.james = { home-manager.users."${user.name}" = {
home.packages = with pkgs; [ xdg-utils xdg-launch ]; home.packages = with pkgs; [ xdg-utils xdg-launch ];
xdg.enable = true; xdg.enable = true;
}; };

View File

@ -1,8 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, user, ... }:
let let
this = config.my.system.yubikey; this = config.my.system.yubikey;
graphical = config.my.graphical; graphical = config.my.graphical;
in with lib; { in
with lib; {
options.my.system.yubikey.enable = mkEnableOption "Yubikey"; options.my.system.yubikey.enable = mkEnableOption "Yubikey";
config = mkIf this.enable { config = mkIf this.enable {
@ -35,7 +36,7 @@ in with lib; {
[ yubioath-desktop pinentry-curses ] [ yubioath-desktop pinentry-curses ]
++ optionals (graphical.enable) [ pinentry-gnome ]; ++ optionals (graphical.enable) [ pinentry-gnome ];
home-manager.users.james.home = { home-manager.users."${user.name}".home = {
packages = with pkgs; packages = with pkgs;
[ yubikey-manager yubikey-personalization ] [ yubikey-manager yubikey-personalization ]
++ optionals (graphical.enable) [ ++ optionals (graphical.enable) [
@ -43,7 +44,8 @@ in with lib; {
yubikey-personalization-gui yubikey-personalization-gui
]; ];
file.".gnupg/gpg-agent.config" = { file.".gnupg/gpg-agent.config" = {
text = if graphical.enable then text =
if graphical.enable then
"pinentry-program ${pkgs.pinentry-gnome}/bin/pinentry" "pinentry-program ${pkgs.pinentry-gnome}/bin/pinentry"
else else
"pinentry-program ${pkgs.pinentry-curses}/bin/pinentry"; "pinentry-program ${pkgs.pinentry-curses}/bin/pinentry";

View File

@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }: { { config, lib, pkgs, user, ... }: {
imports = [ ./graphical.nix ]; imports = [ ./graphical.nix ];
my.system.boot.enable = true; my.system.boot.enable = true;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
users.users.james.extraGroups = [ "networkmanager" ]; users.users."${user.name}".extraGroups = [ "networkmanager" ];
} }