Remove users directory and hosts for non-NixOS machines

Move user account definitions into machine configuration.nix

Move per-host user settings into flake.nix directly
This commit is contained in:
Evie Litherland-Smith 2023-06-28 19:37:23 +01:00
parent f29e4608c9
commit 7364e01d07
12 changed files with 163 additions and 156 deletions

140
flake.nix
View file

@ -26,11 +26,18 @@
... ...
}: let }: let
home-config = { home-config = {
imports = [home-manager.nixosModules.home-manager ./users/root]; imports = [home-manager.nixosModules.home-manager];
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = false; useUserPackages = false;
users.root.imports = [./home/env/bash.nix ./home/env/starship.nix]; users.root = {
imports = [./home/env/bash.nix ./home/env/starship.nix];
home = {
username = "root";
homeDirectory = "/root";
stateVersion = "22.11";
};
};
}; };
}; };
hyprland-config = {pkgs, ...}: { hyprland-config = {pkgs, ...}: {
@ -90,8 +97,17 @@
modules = [ modules = [
home-config home-config
./hosts/Legion ./hosts/Legion
./users/xenia
./services/Legion.nix ./services/Legion.nix
{
home-manager.users.xenia = {
imports = [./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
};
}
]; ];
}; };
Vanguard = nixpkgs.lib.nixosSystem { Vanguard = nixpkgs.lib.nixosSystem {
@ -104,10 +120,32 @@
home-config home-config
hyprland-config hyprland-config
./hosts/Vanguard ./hosts/Vanguard
./users/xenia/Vanguard.nix
./services/sshd ./services/sshd
./services/syncthing/Vanguard.nix ./services/syncthing/Vanguard.nix
{home-manager.users.xenia.imports = [hyprland-home-config];} {
home-manager.users.xenia = {
imports = [hyprland-home-config ./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf
monitor=DP-2,highrr,auto,auto
workspace = name:steam
windowrule = workspace name:steam, [Ss]team.*
bind = ALT, S, moveworkspacetomonitor, name:steam current
bind = ALT, S, workspace, name:steam
bind = ALT SHIFT, S, moveworkspacetomonitor, name:steam current
bind = ALT SHIFT, S, movetoworkspace, name:steam
'';
programs.waybar.settings = {
main."wlr/workspaces"."format-icons"."steam" = "󰓓";
};
};
}
]; ];
}; };
Ronin = nixpkgs.lib.nixosSystem { Ronin = nixpkgs.lib.nixosSystem {
@ -120,20 +158,104 @@
home-config home-config
hyprland-config hyprland-config
./hosts/Ronin ./hosts/Ronin
./users/elitherl/Ronin.nix
./services/syncthing/Ronin.nix ./services/syncthing/Ronin.nix
{home-manager.users.elitherl.imports = [hyprland-home-config];} ({pkgs, ...}: let
laptop-state = pkgs.writeShellScriptBin "check-laptop-lid-state" ''
grep closed /proc/acpi/button/lid/LID0/state &&\
hyprctl keyword monitor "eDP-1,disable" ||\
hyprctl keyword monitor "eDP-1,1920x1080,0x0,1.0"
'';
in {
home-manager.users.elitherl = {
imports = [hyprland-home-config ./home/work.nix];
home = {
username = "elitherl";
homeDirectory = "/home/elitherl";
stateVersion = "22.11";
packages = [laptop-state];
};
wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf
bindl=,switch:Lid Switch,exec,check-laptop-lid-state
exec = ${laptop-state}/bin/check-laptop-lid-state
monitor = DP-3,1920x1200,1920x0,1.0
monitor = DP-4,1920x1080,3840x0,1.0,transform,1
workspace = name:remote
windowrule = workspace name:chat, teams-for-linux
windowrule = workspace name:remote, Nxplayer.*
bind = ALT, R, moveworkspacetomonitor, name:remote current
bind = ALT, R, workspace, name:remote
bind = ALT SHIFT, R, moveworkspacetomonitor, name:remote current
bind = ALT SHIFT, R, movetoworkspace, name:remote
'';
programs.waybar.settings = {
main = {
"output" = "!DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
};
alt = {
"include" = [
"~/.config/waybar/modules.json"
"~/.config/waybar/layout.json"
];
"output" = "DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
"modules-left" = [];
"modules-center" = ["wlr/workspaces"];
"modules-right" = [];
};
};
};
})
]; ];
}; };
}; };
homeConfigurations = { homeConfigurations = {
"tux@Monarch" = home-manager.lib.homeManagerConfiguration { "tux@Monarch" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-darwin"; pkgs = nixpkgs.legacyPackages."aarch64-darwin";
modules = [./hosts/Monarch/home.nix]; modules = [
({pkgs, ...}: {
imports = [./home/personal.nix ./home/gui/wezterm.nix];
home = {
username = "tux";
homeDirectory = "/Users/tux";
stateVersion = "23.05";
packages = [pkgs.gcc];
};
programs = {
home-manager.enable = true;
zsh = {
sessionVariables.CC = "${pkgs.gcc}/bin/gcc";
envExtra = ''
eval "$(/opt/homebrew/bin/brew shellenv)"
'';
};
};
services.syncthing.enable = true;
})
];
}; };
"xenia@Northstar" = home-manager.lib.homeManagerConfiguration { "xenia@Northstar" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages."aarch64-linux"; pkgs = nixpkgs.legacyPackages."aarch64-linux";
modules = [./hosts/Northstar/home.nix]; modules = [
{
imports = [./home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
programs = {
home-manager.enable = true;
bash.bashrcExtra = ''
source $HOME/.nix-profile/etc/profile.d/nix.sh
'';
};
services.syncthing.enable = true;
fonts.fontconfig.enable = true;
}
];
}; };
}; };
}; };

View file

@ -1,5 +1,12 @@
{...}: { {pkgs, ...}: {
imports = [./default.nix ./git/work.nix ./ssh/work.nix]; imports = [./default.nix ./git/work.nix ./ssh/work.nix];
home.packages = with pkgs; [
zotero
openfortivpn
nomachine-client
teams-for-linux
zoom-us
];
programs.fish.functions.fsync = '' programs.fish.functions.fsync = ''
rsync -avz --copy-links --filter=':- .gitignore' --exclude='.git*'\ rsync -avz --copy-links --filter=':- .gitignore' --exclude='.git*'\
--delete-during --delete-excluded\ --delete-during --delete-excluded\

View file

@ -1,7 +1,7 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`). # and in the NixOS manual (accessible by running `nixos-help`).
{...}: { {pkgs, ...}: {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -27,6 +27,14 @@
}; };
}; };
users.users.xenia = {
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix;
};
# 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
# on your system were taken. It's perfectly fine and recommended to leave # on your system were taken. It's perfectly fine and recommended to leave

View file

@ -1,17 +0,0 @@
{pkgs, ...}: {
imports = [../../home/personal.nix ../../home/gui/wezterm.nix];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "tux";
home.homeDirectory = "/Users/tux";
home.stateVersion = "23.05";
home.packages = [pkgs.gcc];
programs.home-manager.enable = true;
programs.zsh = {
sessionVariables.CC = "${pkgs.gcc}/bin/gcc";
envExtra = ''
eval "$(/opt/homebrew/bin/brew shellenv)"
'';
};
services.syncthing.enable = true;
}

View file

@ -1,17 +0,0 @@
{pkgs, ...}: {
imports = [
../../home/personal.nix
../../home/gui/firefox.nix
];
home.username = "xenia";
home.homeDirectory = "/home/xenia";
home.stateVersion = "22.11";
programs.home-manager.enable = true;
programs.bash.bashrcExtra = ''
source $HOME/.nix-profile/etc/profile.d/nix.sh
'';
programs.firefox.package = pkgs.firefox-wayland;
services.syncthing.enable = true;
fonts.fontconfig.enable = true;
}

View file

@ -1,7 +1,7 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{...}: { {pkgs, ...}: {
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -25,6 +25,13 @@
environment.etc."ppp/options".text = '' environment.etc."ppp/options".text = ''
ipcp-accept-remote ipcp-accept-remote
''; '';
users.users.elitherl = {
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
};
services.greetd.settings.initial_session.user = "elitherl"; services.greetd.settings.initial_session.user = "elitherl";
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default

View file

@ -32,6 +32,13 @@
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
hardware.opengl.driSupport32Bit = true; hardware.opengl.driSupport32Bit = true;
users.users.xenia = {
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix;
};
services.greetd.settings.initial_session.user = "xenia"; services.greetd.settings.initial_session.user = "xenia";
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default

View file

@ -1,44 +0,0 @@
{pkgs, ...}: let
laptop-state = pkgs.writeShellScriptBin "check-laptop-lid-state" ''
grep closed /proc/acpi/button/lid/LID0/state &&\
hyprctl keyword monitor "eDP-1,disable" ||\
hyprctl keyword monitor "eDP-1,1920x1080,0x0,1.0"
'';
in {
imports = [./default.nix];
home-manager.users.elitherl = {
home.packages = [laptop-state];
wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf
bindl=,switch:Lid Switch,exec,check-laptop-lid-state
exec = ${laptop-state}/bin/check-laptop-lid-state
monitor = DP-3,1920x1200,1920x0,1.0
monitor = DP-4,1920x1080,3840x0,1.0,transform,1
workspace = name:remote
windowrule = workspace name:chat, teams-for-linux
windowrule = workspace name:remote, Nxplayer.*
bind = ALT, R, moveworkspacetomonitor, name:remote current
bind = ALT, R, workspace, name:remote
bind = ALT SHIFT, R, moveworkspacetomonitor, name:remote current
bind = ALT SHIFT, R, movetoworkspace, name:remote
'';
programs.waybar.settings = {
main = {
"output" = "!DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
};
alt = {
"include" = [
"~/.config/waybar/modules.json"
"~/.config/waybar/layout.json"
];
"output" = "DP-4";
"wlr/workspaces"."format-icons"."remote" = "󰢹";
"modules-left" = [];
"modules-center" = ["wlr/workspaces"];
"modules-right" = [];
};
};
};
}

View file

@ -1,23 +0,0 @@
{pkgs, ...}: {
users.users.elitherl = {
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
};
home-manager.users.elitherl = {
imports = [../../home/work.nix];
home = {
username = "elitherl";
homeDirectory = "/home/elitherl";
stateVersion = "22.11";
packages = with pkgs; [
zotero
openfortivpn
nomachine-client
teams-for-linux
zoom-us
];
};
};
}

View file

@ -1,7 +0,0 @@
{...}: {
home-manager.users.root = {
home.username = "root";
home.homeDirectory = "/root";
home.stateVersion = "22.11";
};
}

View file

@ -1,19 +0,0 @@
{...}: {
imports = [./default.nix];
home-manager.users.xenia = {
wayland.windowManager.hyprland.extraConfig = ''
source=./common.conf
monitor=DP-2,highrr,auto,auto
workspace = name:steam
windowrule = workspace name:steam, [Ss]team.*
bind = ALT, S, moveworkspacetomonitor, name:steam current
bind = ALT, S, workspace, name:steam
bind = ALT SHIFT, S, moveworkspacetomonitor, name:steam current
bind = ALT SHIFT, S, movetoworkspace, name:steam
'';
programs.waybar.settings = {
main."wlr/workspaces"."format-icons"."steam" = "󰓓";
};
};
}

View file

@ -1,17 +0,0 @@
{pkgs, ...}: {
users.users.xenia = {
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel"];
shell = pkgs.fish;
openssh.authorizedKeys.keys = import ../../auth/authorized_keys.nix;
};
home-manager.users.xenia = {
imports = [../../home/personal.nix];
home = {
username = "xenia";
homeDirectory = "/home/xenia";
stateVersion = "22.11";
};
};
}