Compare commits

..

10 Commits

57 changed files with 379 additions and 414 deletions

View File

@ -1,28 +1,37 @@
# Installing on a new machine # Installing on a new machine
1) Install [NixOS](https://nixos.org/) from an ISO via USB 1) Install [NixOS](https://nixos.org/) from an ISO via USB
2) Reboot machine 2) Reboot machine
3) Edit `/etc/nixos/configuration` and add `git` to packages 3) Edit `/etc/nixos/configuration.nix` and add `git` to packages
4) Clone this repo 4) Clone this repo
5) Copy new `host/` configuration for the new machine 5) Create a new directory under `hosts/` for the new machine
6) Copy `/etc/nixos/hardware-configuration` to `host/<host>/hardware.nix` 6) Copy `/etc/nixos/hardware-configuration.nix` to `hosts/<host>/hardware.nix`
7) Edit `flake.nix` to point to the new `host` 7) Register the host in `flake.nix` via `mkHost`:
```nix
nixosConfigurations.<host> = mkHost { host = "<host>"; };
```
8) `git add .` 8) `git add .`
9) Run `sudo nixos-rebuild switch --flake .#nixos` 9) Run `sudo nixos-rebuild switch --flake .#<host>`
# Building NixOS VM # Building NixOS VM
`nix build .#nixosConfigurations.nixosvm.config.system.build.vm` `nix build .#nixosConfigurations.vm.config.system.build.vm`
or run `./build-vm.sh` (removes `./vm.qcow2` first)
https://gist.github.com/FlakM/0535b8aa7efec56906c5ab5e32580adf https://gist.github.com/FlakM/0535b8aa7efec56906c5ab5e32580adf
# Building NixOS ISO # Building NixOS ISO
`nix build .#nixosConfigurations.live.config.system.build.isoImage` `nix build .#nixosConfigurations.live.config.system.build.isoImage`
or run `./build-iso.sh`
# Using Standalone Home Manager # Using Standalone Home Manager
1) Install [Nix](https://nixos.org/) via: 1) Install [Nix](https://nixos.org/) via:
` ```
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
` ```
2) Create `~/.config/nix/nix.conf` file with the following contents to enable the use of flakes: 2) Create `~/.config/nix/nix.conf` file with the following contents to enable the use of flakes:
``` ```
@ -31,17 +40,19 @@ experimental-features = nix-command flakes
3) Install `git` 3) Install `git`
4) Clone this repo 4) Clone this repo
5) Edit `flake.nix` variables as needed 5) Edit `flake.nix` variables as needed
6) `home-manager switch --flake .` 6) `home-manager switch --flake .#josh`
# Misc # Misc
## Garbage collection ## Garbage collection
`nix-collect-garbage -d` `nix-collect-garbage -d`
## Fonts ## Fonts
### Checking installed fonts ### Checking installed fonts
`fc-list` `fc-list`
### Debugging kitty fonts ### Debugging kitty fonts
`kitty --debug-font-fallback` `kitty --debug-font-fallback`
## SDDM virtual keyboard ??ZZ ## SDDM virtual keyboard ??ZZ
- https://unix.stackexchange.com/questions/43976/list-all-valid-kbd-layouts-variants-and-toggle-options-to-use-with-setxkbmap - https://unix.stackexchange.com/questions/43976/list-all-valid-kbd-layouts-variants-and-toggle-options-to-use-with-setxkbmap
- https://github.com/NixOS/nixpkgs/issues/254523 - https://github.com/NixOS/nixpkgs/issues/254523

View File

@ -1,4 +1,4 @@
#/usr/bin/env bash #!/usr/bin/env bash
echo "Building ISO ..." echo "Building ISO ..."
nix build .#nixosConfigurations.live.config.system.build.isoImage nix build .#nixosConfigurations.live.config.system.build.isoImage

View File

@ -1,4 +1,4 @@
#/usr/bin/env bash #!/usr/bin/env bash
echo "Removing old qcow2 disk ..." echo "Removing old qcow2 disk ..."
rm -f ./vm.qcow2 rm -f ./vm.qcow2

102
flake.nix
View File

@ -47,98 +47,72 @@
}@inputs: }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
username = "josh";
profile = "desktop";
homePath = ./. + "/users/${username}/home.nix";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
overlays = [ nix-vscode-extensions.overlays.default ]; overlays = [ nix-vscode-extensions.overlays.default ];
}; };
mkHost =
{
host,
extraModules ? [ ],
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit
homePath
host
inputs
profile
username
;
};
inherit pkgs;
modules = [ ./hosts/${host} ] ++ extraModules;
};
in in
{ {
nixosConfigurations = { nixosConfigurations = {
laptop = let laptop = mkHost { host = "laptop"; };
host = "laptop";
profile = "desktop";
username = "josh";
in nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
pkgs = pkgs;
modules = [
./hosts/${host}
];
};
vm = let vm = mkHost { host = "vm"; };
host = "vm";
profile = "desktop";
username = "josh";
in nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
pkgs = pkgs;
modules = [
./hosts/${host}
];
};
live = let live = mkHost {
host = "installation-iso"; host = "installation-iso";
profile = "desktop"; extraModules = [
username = "josh";
in nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
pkgs = pkgs;
modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix") (nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{ environment.systemPackages = [ install-system.packages.${system}.default ]; } { environment.systemPackages = [ install-system.packages.${system}.default ]; }
./hosts/installation-iso
]; ];
}; };
}; };
homeConfigurations.josh = let homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
profile = "desktop"; extraSpecialArgs = {
username = "josh"; inherit inputs profile username;
gpgSigningKey = null; };
in home-manager.lib.homeManagerConfiguration { inherit pkgs;
extraSpecialArgs = {
inherit inputs;
inherit profile;
inherit username;
};
pkgs = pkgs;
modules = [ modules = [
{ {
modules.gpg.signingKey = gpgSigningKey; modules.gpg.signingKey = null;
} }
./homes/josh/home.nix homePath
stylix.homeModules.stylix stylix.homeModules.stylix
]; ];
}; };
devShell.${system} = nixpkgs.legacyPackages.${system}.pkgs.mkShell { devShell.${system} = pkgs.mkShell {
packages = with nixpkgs.legacyPackages.${system}.pkgs; [ packages = with pkgs; [
nil nil
nixd nixd
]; ];
}; };
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-tree; formatter.${system} = pkgs.nixfmt-tree;
}; };
} }

View File

@ -5,7 +5,7 @@
imports = [ imports = [
../../profiles/desktop ../../profiles/desktop
../../modules/core ../../modules/nixos
../../modules/drivers ../../modules/drivers
../../modules/options ../../modules/options

View File

@ -5,7 +5,7 @@
imports = [ imports = [
../../profiles/desktop ../../profiles/desktop
../../modules/core ../../modules/nixos
../../modules/drivers ../../modules/drivers
../../modules/options ../../modules/options

View File

@ -5,7 +5,7 @@
imports = [ imports = [
../../profiles/desktop ../../profiles/desktop
../../modules/core ../../modules/nixos
../../modules/drivers ../../modules/drivers
../../modules/options ../../modules/options
@ -24,5 +24,5 @@
# drivers.nvidia.enable = false; # drivers.nvidia.enable = false;
# drivers.nvidia-prime.enable = false; # drivers.nvidia-prime.enable = false;
# drivers.intel.enable = false; # drivers.intel.enable = false;
vm.guest-services.enable = true; modules.vm.guestServices.enable = true;
} }

View File

@ -1,22 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
pipewireCfg = config.modules.pipewire;
in
{
# Add wayland screensharing support if PipeWire is enabled
environment.systemPackages =
with pkgs;
[ ]
++ (
if pipewireCfg.enable then
[ (wrapFirefox (firefox-unwrapped.override { pipewireSupport = true; }) { }) ]
else
[ firefox ]
);
}

View File

@ -1,18 +0,0 @@
{
pkgs,
...
}:
{
programs = {
};
environment.systemPackages = with pkgs; [
git
home-manager
tldr
tmux
vim-full
wl-clipboard
];
}

View File

@ -5,13 +5,9 @@
}: }:
with lib; with lib;
let let
cfg = config.vm.guest-services; cfg = config.modules.vm.guestServices;
in in
{ {
options.vm.guest-services = {
enable = mkEnableOption "Enable Virtual Machine Guest Services";
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.qemuGuest.enable = true; services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = true;

View File

@ -15,4 +15,4 @@ in
package = pkgs.discord; package = pkgs.discord;
}; };
}; };
} }

101
modules/home/firefox.nix Normal file
View File

@ -0,0 +1,101 @@
{
config,
pkgs,
username,
...
}:
{
programs.firefox = {
enable = true;
package = pkgs.firefox;
configPath = "${config.xdg.configHome}/mozilla/firefox";
policies = {
# Updates & Background Services
AppAutoUpdate = false;
BackgroundAppUpdate = false;
# Quality of Life
OfferToSaveLogins = false;
# Extensions
ExtensionSettings =
let
moz = short: "https://addons.mozilla.org/firefox/downloads/latest/${short}/latest.xpi";
in
{
"*".installation_mode = "blocked";
# uBlock Origin
"uBlock0@raymondhill.net" = {
install_url = moz "ublock-origin";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "navbar";
};
# Bitwarden
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
install_url = moz "bitwarden-password-manager";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "navbar";
};
# Dark Reader
"addon@darkreader.org" = {
install_url = moz "darkreader";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "navbar";
};
# SponsorBlock
"sponsorBlocker@ajay.app" = {
install_url = moz "sponsorblock";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "menupanel";
};
# Return YouTube Dislike
"{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = {
install_url = moz "return-youtube-dislikes";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "menupanel";
};
# RES
"jid1-xUfzOsOFlzSOXg@jetpack" = {
install_url = moz "reddit-enhancement-suite";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "menupanel";
};
};
"3rdparty".Extensions = {
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
environment = {
base = "https://bitwarden.joshuayuen.me";
};
};
};
profiles = {
${username} = {
id = 0;
isDefault = true;
name = "${username}";
};
};
};
};
}

View File

@ -5,7 +5,8 @@
... ...
}: }:
with lib; with lib;
let hyprlandCfg = config.modules.hyprland; let
hyprlandCfg = config.modules.hyprland;
in in
{ {
imports = [ inputs.walker.homeManagerModules.default ]; imports = [ inputs.walker.homeManagerModules.default ];
@ -14,4 +15,4 @@ in
enable = true; enable = true;
runAsService = true; runAsService = true;
}; };
} }

View File

@ -0,0 +1,107 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.zsh;
xdgCfg = config.xdg;
in
{
imports = [
./completion.nix
./p10k.nix
];
programs.zsh = {
enable = cfg.enable;
dotDir = "${xdgCfg.configHome}/zsh";
autosuggestion.enable = false;
enableCompletion = false;
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
"pattern"
"root"
];
};
historySubstringSearch.enable = true;
history = {
append = true;
ignoreDups = false;
ignoreSpace = true;
save = 100000;
share = true;
size = 100000;
extended = true;
};
initContent =
let
zshConfigInitEarly = mkOrder 500 ''
# p10k
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
source "${xdgCfg.configHome}/zsh/p10k.zsh";
'';
zshConfig = mkOrder 1000 ''
# Autocompletion and menu styling
zmodload zsh/complist
autoload -Uz compinit && compinit
source "${xdgCfg.configHome}/zsh/completion.zsh";
# vi keybindings for menu select
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -M menuselect 'l' vi-forward-char
# Tab to accept current selection
bindkey -M menuselect '^I' accept-and-infer-next-history
# Control arrow keys
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
# Control backspace
bindkey '^H' backward-kill-word
'';
in
mkMerge [
zshConfigInitEarly
zshConfig
];
shellAliases = {
".." = "cd ..";
"..." = "cd ../..";
ls = "ls --color=auto";
ll = "ls -al";
grep = "grep --color=auto";
back = "cd $OLDPWD";
gs = "git status";
ssha = "eval $(ssh-agent) && ssh-add";
};
plugins = [
{
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/";
file = "powerlevel10k.zsh-theme";
}
{
name = "zsh-autocomplete";
src = "${pkgs.zsh-autocomplete}/share/zsh-autocomplete/";
file = "zsh-autocomplete.zsh";
}
];
};
}

View File

@ -1,99 +0,0 @@
{
config,
pkgs,
username,
...
}:
{
programs.firefox = {
enable = true;
package = pkgs.firefox;
configPath = "${config.xdg.configHome}/mozilla/firefox";
policies = {
# Updates & Background Services
AppAutoUpdate = false;
BackgroundAppUpdate = false;
# Quality of Life
OfferToSaveLogins = false;
# Extensions
ExtensionSettings = let
moz = short: "https://addons.mozilla.org/firefox/downloads/latest/${short}/latest.xpi";
in {
"*".installation_mode = "blocked";
# uBlock Origin
"uBlock0@raymondhill.net" = {
install_url = moz "ublock-origin";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "navbar";
};
# Bitwarden
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
install_url = moz "bitwarden-password-manager";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "navbar";
};
# Dark Reader
"addon@darkreader.org" = {
install_url = moz "darkreader";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "navbar";
};
# SponsorBlock
"sponsorBlocker@ajay.app" = {
install_url = moz "sponsorblock";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "menupanel";
};
# Return YouTube Dislike
"{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = {
install_url = moz "return-youtube-dislikes";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "menupanel";
};
# RES
"jid1-xUfzOsOFlzSOXg@jetpack" = {
install_url = moz "reddit-enhancement-suite";
installation_mode = "force_installed";
updates_disabled = true;
private_browsing = true;
default_area = "menupanel";
};
};
"3rdparty".Extensions = {
"{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
environment = {
base = "https://bitwarden.joshuayuen.me";
};
};
};
profiles = {
${username} = {
id = 0;
isDefault = true;
name = "${username}";
};
};
};
};
}

View File

@ -1,103 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.zsh;
xdgCfg = config.xdg;
in
{
imports = [
./completion.nix
./p10k.nix
];
programs.zsh = {
enable = cfg.enable;
dotDir = "${xdgCfg.configHome}/zsh";
autosuggestion.enable = false;
enableCompletion = false;
syntaxHighlighting = {
enable = true;
highlighters = [
"main"
"brackets"
"pattern"
"root"
];
};
historySubstringSearch.enable = true;
history = {
append = true;
ignoreDups = false;
ignoreSpace = true;
save = 100000;
share = true;
size = 100000;
extended = true;
};
initContent =
let
zshConfigInitEarly = mkOrder 500 ''
# p10k
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
source "${xdgCfg.configHome}/zsh/p10k.zsh";
'';
zshConfig = mkOrder 1000 ''
# Autocompletion and menu styling
zmodload zsh/complist
autoload -Uz compinit && compinit
source "${xdgCfg.configHome}/zsh/completion.zsh";
# vi keybindings for menu select
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -M menuselect 'l' vi-forward-char
# Tab to accept current selection
bindkey -M menuselect '^I' accept-and-infer-next-history
# Control arrow keys
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
# Control backspace
bindkey '^H' backward-kill-word
'';
in mkMerge [ zshConfigInitEarly zshConfig ];
shellAliases = {
".." = "cd ..";
"..." = "cd ../..";
ls = "ls --color=auto";
ll = "ls -al";
grep = "grep --color=auto";
back = "cd $OLDPWD";
gs = "git status";
ssha = "eval $(ssh-agent) && ssh-add";
};
plugins = [
{
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/";
file = "powerlevel10k.zsh-theme";
}
{
name = "zsh-autocomplete";
src = "${pkgs.zsh-autocomplete}/share/zsh-autocomplete/";
file = "zsh-autocomplete.zsh";
}
];
};
}

View File

@ -7,7 +7,7 @@
loader.systemd-boot = { loader.systemd-boot = {
enable = true; enable = true;
configurationLimit = 10; configurationLimit = 10;
consoleMode = config.system.systemdBootConsoleMode; consoleMode = config.modules.system.systemdBootConsoleMode;
}; };
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
}; };

View File

@ -4,10 +4,10 @@
{ {
imports = [ imports = [
./boot.nix ./boot.nix
./firefox.nix
./fonts.nix ./fonts.nix
./gdm.nix ./gdm.nix
./gnomeBoxes.nix ./gnomeBoxes.nix
./home-manager.nix
./hyprland.nix ./hyprland.nix
./localsend.nix ./localsend.nix
./network.nix ./network.nix

View File

@ -5,10 +5,10 @@
}: }:
with lib; with lib;
let let
cfg = config.modules.displayManager; cfg = config.modules.display;
in in
{ {
config = mkIf (cfg.displayManager == "gdm") { config = mkIf (cfg.manager == "gdm") {
services.displayManager.gdm = { services.displayManager.gdm = {
enable = true; enable = true;
}; };

View File

@ -2,13 +2,12 @@
config, config,
host, host,
inputs, inputs,
pkgs, homePath,
profile, profile,
username, username,
... ...
}: }:
let let
shellCfg = config.modules.shell;
zshCfg = config.modules.zsh; zshCfg = config.modules.zsh;
in in
{ {
@ -26,34 +25,19 @@ in
; ;
}; };
users.${username} = { users.${username} = {
imports = [ ../../homes/${username}/home.nix ]; imports = [ homePath ];
modules.gpg.signingKey = config.modules.gpg.signingKey; modules.gpg.signingKey = config.modules.gpg.signingKey;
modules.display.scale = config.modules.display.scale; modules.display.scale = config.modules.display.scale;
}; };
}; };
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
initialPassword = "changeme";
extraGroups = [
"networkmanager"
"wheel"
];
shell = pkgs.${shellCfg.defaultShell};
ignoreShellProgramCheck = true;
packages = with pkgs; [
];
};
# Set /etc/shells so GDM will show our user when ZSH is selected
environment.shells = [ pkgs.${shellCfg.defaultShell} ];
environment.pathsToLink = environment.pathsToLink =
# Since Home Manager is installed via its NixOS module, we need to add this so that # Since Home Manager is installed via its NixOS module, we need to add this so that
# the portal definitions and DE provided configurations get linked # the portal definitions and DE provided configurations get linked
[ "/share/applications" "/share/xdg-desktop-portal" ] [
"/share/applications"
"/share/xdg-desktop-portal"
]
# Needed to get completion for system packages (e.g. systemd) # Needed to get completion for system packages (e.g. systemd)
++ (if zshCfg.enable then [ "/share/zsh" ] else [ ]); ++ (if zshCfg.enable then [ "/share/zsh" ] else [ ]);
} }

View File

@ -13,4 +13,4 @@ in
enable = true; enable = true;
}; };
}; };
} }

View File

@ -0,0 +1,5 @@
{
...
}:
{
}

View File

@ -5,10 +5,10 @@
}: }:
with lib; with lib;
let let
cfg = config.modules.displayManager; cfg = config.modules.display;
in in
{ {
config = mkIf (cfg.displayManager == "sddm") { config = mkIf (cfg.manager == "sddm") {
services.displayManager.sddm = { services.displayManager.sddm = {
enable = true; enable = true;
wayland.enable = true; wayland.enable = true;

View File

@ -12,4 +12,4 @@
polarity = "dark"; polarity = "dark";
}; };
} }

View File

@ -1,17 +1,31 @@
{ {
config, config,
username,
... ...
}: }:
let let
cfg = config.system; cfg = config.modules.system;
in in
{ {
nix = { nix = {
settings = { settings = {
allowed-users = [ username ];
trusted-users = [
"@wheel"
username
];
experimental-features = [ experimental-features = [
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
extra-substituters = [
"https://walker.cachix.org"
"https://walker-git.cachix.org"
];
extra-trusted-public-keys = [
"walker.cachix.org-1:fG8q+uAaMqhsMxWjwvk0IMb4mFPFLqHjuvfwQxE4oJM="
"walker-git.cachix.org-1:vmC0ocfPWh0S/vRAQGtChuiZBTAe4wiKDeyyXM0/7pM="
];
}; };
}; };

28
modules/nixos/user.nix Normal file
View File

@ -0,0 +1,28 @@
{
config,
pkgs,
username,
...
}:
let
shellCfg = config.modules.shell;
in
{
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
initialPassword = "changeme";
extraGroups = [
"networkmanager"
"wheel"
];
shell = pkgs.${shellCfg.defaultShell};
ignoreShellProgramCheck = true;
packages = with pkgs; [
];
};
# Set /etc/shells so GDM will show our user when ZSH is selected
environment.shells = [ pkgs.${shellCfg.defaultShell} ];
}

View File

@ -11,4 +11,4 @@ in
config = mkIf zshCfg.enable { config = mkIf zshCfg.enable {
programs.zsh.enable = true; programs.zsh.enable = true;
}; };
} }

View File

@ -5,7 +5,6 @@
imports = [ imports = [
./discord.nix ./discord.nix
./display.nix ./display.nix
./displayManager.nix
./gnomeBoxes.nix ./gnomeBoxes.nix
./gpg.nix ./gpg.nix
./hyprland.nix ./hyprland.nix
@ -15,6 +14,7 @@
./shell.nix ./shell.nix
./system.nix ./system.nix
./tailscale.nix ./tailscale.nix
./vm.nix
./zsh.nix ./zsh.nix
]; ];
} }

View File

@ -5,6 +5,17 @@
with lib; with lib;
{ {
options.modules.display = { options.modules.display = {
manager = mkOption {
type = types.enum [
"gdm"
"sddm"
];
default = "sddm";
description = ''
The display manager to use.
'';
};
scale = mkOption { scale = mkOption {
type = types.int; type = types.int;
default = 1; default = 1;

View File

@ -1,19 +0,0 @@
{
lib,
...
}:
with lib;
{
options.modules.displayManager = {
displayManager = mkOption {
type = types.enum [
"gdm"
"sddm"
];
default = "sddm";
description = ''
The display manager to use.
'';
};
};
}

View File

@ -4,7 +4,7 @@
}: }:
with lib; with lib;
{ {
options.system = { options.modules.system = {
locale = mkOption { locale = mkOption {
type = types.str; type = types.str;
default = "en_US.UTF-8"; default = "en_US.UTF-8";

12
modules/options/vm.nix Normal file
View File

@ -0,0 +1,12 @@
{
lib,
...
}:
with lib;
{
options.modules.vm = {
guestServices = {
enable = mkEnableOption "Virtual Machine guest services";
};
};
}

View File

@ -2,10 +2,6 @@
... ...
}: }:
{ {
imports = [
../../modules/options
];
modules.hyprland = { modules.hyprland = {
enable = true; enable = true;
terminal = "kitty"; terminal = "kitty";
@ -15,7 +11,7 @@
]; ];
}; };
modules.plasma.enable = false; modules.plasma.enable = false;
modules.displayManager.displayManager = "gdm"; modules.display.manager = "gdm";
modules.localsend.enable = true; modules.localsend.enable = true;
@ -27,4 +23,4 @@
modules.discord.enable = true; modules.discord.enable = true;
modules.tailscale.enable = true; modules.tailscale.enable = true;
} }

View File

@ -3,14 +3,16 @@
lib, lib,
pkgs, pkgs,
profile, profile,
username,
... ...
}: }:
with lib; with lib;
let gpgCfg = config.modules.gpg; let
gpgCfg = config.modules.gpg;
in in
{ {
imports = [ imports = [
../../modules/homes ../../modules/home
../../modules/options ../../modules/options
../../profiles/${profile} ../../profiles/${profile}
]; ];
@ -19,9 +21,13 @@ in
modules.shell.defaultShell = "zsh"; modules.shell.defaultShell = "zsh";
home = { home = {
username = "josh"; inherit username;
homeDirectory = "/home/josh"; homeDirectory = "/home/${username}";
stateVersion = "25.11"; stateVersion = "25.11";
sessionVariables = {
EDITOR = "vim";
VISUAL = "vim";
};
packages = with pkgs; [ packages = with pkgs; [
git git
@ -50,24 +56,4 @@ in
# Let Home Manager install and manage itself # Let Home Manager install and manage itself
programs.home-manager.enable = true; programs.home-manager.enable = true;
}
nix = {
package = mkDefault pkgs.nix;
settings = {
allowed-users = [ "josh" ];
trusted-users = [ "root" "@wheel" "josh" ];
experimental-features = [
"nix-command"
"flakes"
];
extra-substituters = [
"https://walker.cachix.org"
"https://walker-git.cachix.org"
];
extra-trusted-public-keys = [
"walker.cachix.org-1:fG8q+uAaMqhsMxWjwvk0IMb4mFPFLqHjuvfwQxE4oJM="
"walker-git.cachix.org-1:vmC0ocfPWh0S/vRAQGtChuiZBTAe4wiKDeyyXM0/7pM="
];
};
};
}