Compare commits

..

No commits in common. "a37bdf6c60b6af9d88a48eb70a4ea0806e4d8d9e" and "8998c1078b91af0b96e683b73fc8eaffb89b7e60" have entirely different histories.

42 changed files with 218 additions and 298 deletions

43
.vscode/settings.json vendored
View File

@ -1,43 +0,0 @@
{
// Nix settings
"nix.enableLanguageServer": true,
"nix.serverPath": "nixd",
"nix.serverSettings": {
"nil": {
"formatting": {
"command": ["nix fmt"]
},
"nix": {
"flake": {
"maxMemoryMB": 16384,
"autoEvalInputs": true,
"nixpkgsInputName": "nixpkgs"
}
}
},
"nixd": {
"nixpkgs": {
"expr": "import (builtins.getFlake (builtins.toString ./.)).inputs.nixpkgs { }"
},
"formatting": {
"command": [
"nix fmt"
]
},
"options": {
"nixos": {
"expr": "(builtins.getFlake (builtins.toString ./.)).nixosConfigurations.nixos.options"
},
"nixos-home-manager": {
"expr": "(builtins.getFlake (builtins.toString ./.)).nixosConfigurations.nixos.options.home-manager.users.type.getSubOptions []"
},
// "home-manager": {
// "expr": "(builtins.getFlake (builtins.toString ./)).homeConfigurations.<name>.options"
// }
}
}
},
"nixEnvSelector.useFlakes": true,
"nixEnvSelector.suggestion": true,
"nixEnvSelector.nixFile": "${workspaceFolder}/flake.nix",
}

View File

@ -15,17 +15,4 @@
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`
# Misc
## Garbage collection
`nix-collect-garbage -d`
## Fonts
### Checking installed fonts
`fc-list`
### Debugging kitty fonts
`kitty --debug-font-fallback`
## SDDM virtual keyboard ??ZZ
- 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

107
flake.nix
View File

@ -18,70 +18,53 @@
}; };
}; };
outputs = outputs = { nixpkgs, home-manager, install-system, ... } @ inputs: let
{ system = "x86_64-linux";
nixpkgs, host = "vm";
home-manager, profile = "vm";
install-system, username = "josh";
... in {
}@inputs: nixosConfigurations = {
let nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; inherit system;
host = "vm"; specialArgs = {
profile = "vm"; inherit inputs;
username = "josh"; inherit host;
in inherit profile;
{ inherit username;
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
./hosts/${host}
];
}; };
modules = [
live = nixpkgs.lib.nixosSystem { ./hosts/${host}
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
./hosts/${host}
];
};
nixosvm = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
./hosts/${host}
];
};
};
devShell.${system} = nixpkgs.legacyPackages.${system}.pkgs.mkShell {
packages = with nixpkgs.legacyPackages.${system}.pkgs; [
nil
nixd
]; ];
}; };
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-tree; live = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
./hosts/${host}
];
};
nixosvm = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
./hosts/${host}
];
};
}; };
} };
}

View File

@ -26,4 +26,4 @@
modules.shell.defaultShell = "zsh"; modules.shell.defaultShell = "zsh";
modules.pipewire.enable = true; modules.pipewire.enable = true;
} }

View File

@ -1,3 +1,3 @@
{ {
} }

View File

@ -4,6 +4,6 @@
}: }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
]; ];
} }

View File

@ -6,4 +6,4 @@
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;
}; };
} }

View File

@ -20,4 +20,4 @@
./user.nix ./user.nix
inputs.stylix.nixosModules.stylix inputs.stylix.nixosModules.stylix
]; ];
} }

View File

@ -14,13 +14,8 @@ in
}; };
# Add wayland screensharing support if PipeWire is enabled # Add wayland screensharing support if PipeWire is enabled
environment.systemPackages = environment.systemPackages = with pkgs; []
with pkgs; ++ (if pipewireCfg.enable
[ ] then [ (wrapFirefox (firefox-unwrapped.override { pipewireSupport = true; }) {}) ]
++ ( else [ firefox ]);
if pipewireCfg.enable then }
[ (wrapFirefox (firefox-unwrapped.override { pipewireSupport = true; }) { }) ]
else
[ firefox ]
);
}

View File

@ -6,14 +6,13 @@
{ {
fonts = { fonts = {
fontconfig.enable = true; fontconfig.enable = true;
packages = packages = with pkgs; [
with pkgs; font-awesome
[ montserrat
font-awesome nerd-fonts.jetbrains-mono
montserrat noto-fonts-emoji
nerd-fonts.jetbrains-mono ] ++ (if config.modules.zsh.enable
noto-fonts-emoji then [ nerd-fonts.meslo-lg ]
] else []);
++ (if config.modules.zsh.enable then [ nerd-fonts.meslo-lg ] else [ ]);
}; };
} }

View File

@ -14,4 +14,4 @@ in
wayland = true; wayland = true;
}; };
}; };
} }

View File

@ -14,4 +14,4 @@ in
withUWSM = true; withUWSM = true;
}; };
}; };
} }

View File

@ -1,4 +1,5 @@
{ {
config,
host, host,
pkgs, pkgs,
... ...
@ -11,4 +12,4 @@
}; };
environment.systemPackages = with pkgs; [ networkmanagerapplet ]; environment.systemPackages = with pkgs; [ networkmanagerapplet ];
} }

View File

@ -1,4 +1,5 @@
{ {
config,
pkgs, pkgs,
... ...
}: }:
@ -13,4 +14,4 @@
tmux tmux
vim vim
]; ];
} }

View File

@ -22,4 +22,4 @@ in
# Allows Pipewire to use the realtime scheduler for increased performance # Allows Pipewire to use the realtime scheduler for increased performance
security.rtkit.enable = true; security.rtkit.enable = true;
}; };
} }

View File

@ -11,4 +11,4 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.desktopManager.plasma6.enable = true; services.desktopManager.plasma6.enable = true;
}; };
} }

View File

@ -18,8 +18,6 @@ in
}; };
# To prevent getting stuck at shutdown # To prevent getting stuck at shutdown
systemd.settings.Manager = { systemd.extraConfig = "DefaultTimeoutStopSec=10s";
DefaultTimeoutStopSec = "10s";
};
}; };
} }

View File

@ -5,4 +5,4 @@
services = { services = {
}; };
} }

View File

@ -6,12 +6,12 @@
stylix = { stylix = {
enable = true; enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/blueish.yaml"; base16Scheme = "${pkgs.base16-schemes}/share/themes/blueish.yaml";
polarity = "dark"; polarity = "dark";
fonts = { fonts = {
emoji = { emoji = {
package = pkgs.noto-fonts-emoji; package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji"; name = "Noto Color Emoji";
}; };
monospace = { monospace = {
@ -34,4 +34,4 @@
}; };
}; };
}; };
} }

View File

@ -1,9 +1,11 @@
{ {
config, config,
lib,
... ...
}: }:
with lib;
let let
cfg = config.system; cfg = config.system;
in in
{ {
nix = { nix = {
@ -33,4 +35,4 @@ in
}; };
system.stateVersion = "25.05"; system.stateVersion = "25.05";
} }

View File

@ -2,11 +2,13 @@
config, config,
host, host,
inputs, inputs,
lib,
pkgs, pkgs,
profile, profile,
username, username,
... ...
}: }:
with lib;
let let
shellCfg = config.modules.shell; shellCfg = config.modules.shell;
in in
@ -16,14 +18,7 @@ in
useUserPackages = true; useUserPackages = true;
useGlobalPkgs = false; useGlobalPkgs = false;
backupFileExtension = "backup"; backupFileExtension = "backup";
extraSpecialArgs = { extraSpecialArgs = { inherit host inputs profile username; };
inherit
host
inputs
profile
username
;
};
users.${username} = { users.${username} = {
imports = [ ./../home ]; imports = [ ./../home ];
home = { home = {
@ -44,13 +39,10 @@ in
]; ];
shell = pkgs.${shellCfg.defaultShell}; shell = pkgs.${shellCfg.defaultShell};
ignoreShellProgramCheck = true; ignoreShellProgramCheck = true;
packages = with pkgs; [
fzf
];
}; };
# Set /etc/shells so GDM will show our user when ZSH is selected # Set /etc/shells so GDM will show our user when ZSH is selected
environment.shells = [ pkgs.${shellCfg.defaultShell} ]; environment.shells = with pkgs; [ pkgs.${shellCfg.defaultShell} ];
nix.settings.allowed-users = [ "${username}" ]; nix.settings.allowed-users = [ "${username}" ];
} }

View File

@ -5,4 +5,4 @@
imports = [ imports = [
./vm-guest-services.nix ./vm-guest-services.nix
]; ];
} }

View File

@ -1,6 +1,7 @@
{ {
config, config,
lib, lib,
pkgs,
... ...
}: }:
with lib; with lib;
@ -17,4 +18,4 @@ in
services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = true;
services.spice-webdavd.enable = true; services.spice-webdavd.enable = true;
}; };
} }

View File

@ -1,4 +1,5 @@
{ {
host,
... ...
}: }:
{ {
@ -8,4 +9,4 @@
./xdg.nix ./xdg.nix
./zsh ./zsh
]; ];
} }

View File

@ -1,7 +1,9 @@
{ {
lib,
osConfig, osConfig,
... ...
}: }:
with lib;
let let
cfg = osConfig.modules.hyprland; cfg = osConfig.modules.hyprland;
in in
@ -10,7 +12,7 @@ in
bind = [ bind = [
# Misc # Misc
"$modifier,Return,exec,${cfg.terminal}" "$modifier,Return,exec,${cfg.terminal}"
# Window management # Window management
"$modifier,C,killactive" "$modifier,C,killactive"
"$modifier,F,fullscreen, 1" "$modifier,F,fullscreen, 1"
@ -54,4 +56,4 @@ in
"$modifier,mouse:273,resizewindow" "$modifier,mouse:273,resizewindow"
]; ];
}; };
} }

View File

@ -6,4 +6,4 @@
./binds.nix ./binds.nix
./hyprland.nix ./hyprland.nix
]; ];
} }

View File

@ -1,4 +1,5 @@
{ {
host,
lib, lib,
osConfig, osConfig,
pkgs, pkgs,
@ -61,4 +62,4 @@ in
}; };
}; };
}; };
} }

View File

@ -1,4 +1,5 @@
{ {
config,
lib, lib,
osConfig, osConfig,
pkgs, pkgs,
@ -28,4 +29,4 @@ in
''; '';
}; };
}; };
} }

View File

@ -1,8 +1,10 @@
{ {
lib,
osConfig, osConfig,
pkgs, pkgs,
... ...
}: }:
with lib;
let let
hyprlandCfg = osConfig.modules.hyprland; hyprlandCfg = osConfig.modules.hyprland;
pipewireCfg = osConfig.modules.pipewire; pipewireCfg = osConfig.modules.pipewire;
@ -15,31 +17,27 @@ in
mimeApps.enable = true; mimeApps.enable = true;
portal = { portal = {
enable = true; enable = true;
extraPortals = extraPortals = []
[ ] ++ (if hyprlandCfg.enable
++ (if hyprlandCfg.enable then [ pkgs.xdg-desktop-portal-hyprland ] else [ ]) then [ pkgs.xdg-desktop-portal-hyprland ]
++ ( else [])
if pipewireCfg.enable then ++ (if pipewireCfg.enable
[ then [
pkgs.xdg-desktop-portal-wlr pkgs.xdg-desktop-portal-wlr
pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gtk
] ]
else else [])
[ ] ++ (if plasmaCfg.enable
) then [ pkgs.kdePackages.xdg-desktop-portal-kde ]
++ (if plasmaCfg.enable then [ pkgs.kdePackages.xdg-desktop-portal-kde ] else [ ]); else []);
configPackages = configPackages = []
[ ] ++ (if hyprlandCfg.enable
++ (if hyprlandCfg.enable then [ pkgs.hyprland ] else [ ]) then [ pkgs.hyprland ]
++ ( else [])
if ++ (if plasmaCfg.enable
plasmaCfg.enable # TODO: use the correct packages or config
# TODO: use the correct packages or config then [ pkgs.kdePackages.kde-gtk-config ]
then else []);
[ pkgs.kdePackages.kde-gtk-config ]
else
[ ]
);
}; };
}; };
} }

View File

@ -1,9 +1,12 @@
{ {
config, config,
lib,
osConfig, osConfig,
pkgs, pkgs,
profile,
... ...
}: }:
with lib;
let let
cfg = osConfig.modules.zsh; cfg = osConfig.modules.zsh;
xdgCfg = config.xdg; xdgCfg = config.xdg;
@ -16,8 +19,7 @@ in
programs.zsh = { programs.zsh = {
enable = cfg.enable; enable = cfg.enable;
dotDir = "${xdgCfg.configHome}/zsh"; dotDir = "${xdgCfg.configHome}/zsh";
autosuggestion.enable = false; autosuggestion.enable = true;
enableCompletion = true;
syntaxHighlighting = { syntaxHighlighting = {
enable = true; enable = true;
highlighters = [ highlighters = [
@ -29,13 +31,9 @@ in
}; };
historySubstringSearch.enable = true; historySubstringSearch.enable = true;
history = { history = {
append = true;
ignoreDups = false; ignoreDups = false;
ignoreSpace = true;
save = 100000; save = 100000;
share = true;
size = 100000; size = 100000;
extended = true;
}; };
initContent = '' initContent = ''
@ -50,16 +48,6 @@ in
# Tab to accept current selection # Tab to accept current selection
bind-key -M menuselect '^I' accept-and-infer-next-history bind-key -M menuselect '^I' accept-and-infer-next-history
# Control arrow keys
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
# Load fzf keybindings
if [ -n "''${commands[fzf-share]}" ]; then
source "$(fzf-share)/key-bindings.zsh";
source "$(fzf-share)/completion.zsh";
fi
''; '';
shellAliases = { shellAliases = {
@ -81,4 +69,4 @@ in
} }
]; ];
}; };
} }

View File

@ -2,6 +2,7 @@
config, config,
lib, lib,
osConfig, osConfig,
pkgs,
... ...
}: }:
with lib; with lib;
@ -15,4 +16,4 @@ in
source = ./p10k.zsh; source = ./p10k.zsh;
}; };
}; };
} }

View File

@ -11,4 +11,4 @@
./system.nix ./system.nix
./zsh.nix ./zsh.nix
]; ];
} }

View File

@ -1,8 +1,12 @@
{ {
config,
lib, lib,
... ...
}: }:
with lib; with lib;
let
cfg = config.modules.displayManager;
in
{ {
options.modules.displayManager = { options.modules.displayManager = {
displayManager = mkOption { displayManager = mkOption {
@ -16,4 +20,4 @@ with lib;
''; '';
}; };
}; };
} }

View File

@ -1,12 +1,16 @@
{ {
config,
lib, lib,
... ...
}: }:
with lib; with lib;
let
cfg = config.modules.hyprland;
in
{ {
options.modules.hyprland = { options.modules.hyprland = {
enable = mkEnableOption { enable = mkEnableOption {
default = false; default = false;
description = "Enable Hyprland"; description = "Enable Hyprland";
}; };
terminal = mkOption { terminal = mkOption {
@ -22,9 +26,9 @@ with lib;
monitor = mkOption { monitor = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ ",preferred,auto,1" ]; default = [ ",preferred,auto,1" ];
description = '' description = ''
Monitors to use for Hyprland. Monitors to use for Hyprland.
''; '';
}; };
}; };
} }

View File

@ -1,8 +1,12 @@
{ {
config,
lib, lib,
... ...
}: }:
with lib; with lib;
let
cfg = config.modules.pipewire;
in
{ {
options.modules.pipewire = { options.modules.pipewire = {
enable = mkEnableOption { enable = mkEnableOption {
@ -10,4 +14,4 @@ with lib;
description = "Enable PipeWire"; description = "Enable PipeWire";
}; };
}; };
} }

View File

@ -1,8 +1,12 @@
{ {
config,
lib, lib,
... ...
}: }:
with lib; with lib;
let
cfg = config.modules.plasma;
in
{ {
options.modules.plasma = { options.modules.plasma = {
enable = mkEnableOption { enable = mkEnableOption {
@ -10,4 +14,4 @@ with lib;
description = "Enable Plasma"; description = "Enable Plasma";
}; };
}; };
} }

View File

@ -22,17 +22,11 @@ in
}; };
}; };
config.assertions = config.assertions = []
[ ] ++ (if cfg.defaultShell == "zsh"
++ ( then [{
if cfg.defaultShell == "zsh" then
[
{
assertion = zshCfg.enable; assertion = zshCfg.enable;
message = "You have selected zsh as the default shell, but you haven't enabled it in your configuration.\n\nPlease enable it by adding `modules.zsh.enable = true`."; message = "You have selected zsh as the default shell, but you haven't enabled it in your configuration.\n\nPlease enable it by adding `modules.zsh.enable = true`.";
} }]
] else []);
else }
[ ]
);
}

View File

@ -1,16 +1,20 @@
{ {
config,
lib, lib,
... ...
}: }:
with lib; with lib;
let
cfg = config.system;
in
{ {
options.system = { options.system = {
locale = mkOption { locale = mkOption {
type = types.str; type = types.str;
default = "en_US.UTF-8"; default = "en_US.UTF-8";
}; };
keyMap = mkOption { keyMap = mkOption {
type = types.str; type = types.str;
default = "us"; default = "us";
}; };
@ -20,4 +24,4 @@ with lib;
default = "US/Eastern"; default = "US/Eastern";
}; };
}; };
} }

View File

@ -1,8 +1,12 @@
{ {
config,
lib, lib,
... ...
}: }:
with lib; with lib;
let
cfg = config.modules.zsh;
in
{ {
options.modules.zsh = { options.modules.zsh = {
enable = mkEnableOption { enable = mkEnableOption {
@ -10,4 +14,4 @@ with lib;
default = true; default = true;
}; };
}; };
} }

View File

@ -19,4 +19,4 @@
# drivers.nvidia-prime.enable = false; # drivers.nvidia-prime.enable = false;
# drivers.intel.enable = false; # drivers.intel.enable = false;
vm.guest-services.enable = true; vm.guest-services.enable = true;
} }

View File

@ -2,32 +2,29 @@
description = "_template package and shell environment"; description = "_template package and shell environment";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
}; };
outputs = outputs = { self, nixpkgs, ... }: let
{ nixpkgs, ... }: system = "x86_64-linux";
let pkgs = nixpkgs.legacyPackages.${system}.pkgs;
system = "x86_64-linux"; name = builtins.baseNameOf (builtins.toString ./.);
pkgs = nixpkgs.legacyPackages.${system}.pkgs; shellApplication = pkgs.writeShellApplication {
name = builtins.baseNameOf (builtins.toString ./.); inherit name;
shellApplication = pkgs.writeShellApplication {
inherit name;
text = builtins.readFile ./${name}.sh; text = builtins.readFile ./${name}.sh;
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
coreutils coreutils
gnused gnused
unixtools.column unixtools.column
]; ];
};
in
{
packages.${system}.default = shellApplication;
devShells.${system}.default = pkgs.mkShell {
packages = [ shellApplication ];
};
}; };
} in {
packages.${system}.default = shellApplication;
devShells.${system}.default = pkgs.mkShell {
packages = [ shellApplication ];
};
};
}

View File

@ -2,31 +2,28 @@
description = "install-system package and shell environment"; description = "install-system package and shell environment";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
}; };
outputs = outputs = { self, nixpkgs, ... }: let
{ nixpkgs, ... }: pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
let name = builtins.baseNameOf (builtins.toString ./.);
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs; shellApplication = pkgs.writeShellApplication {
name = builtins.baseNameOf (builtins.toString ./.); inherit name;
shellApplication = pkgs.writeShellApplication {
inherit name;
text = builtins.readFile ./${name}.sh; text = builtins.readFile ./${name}.sh;
runtimeInputs = with pkgs; [ runtimeInputs = with pkgs; [
coreutils coreutils
gnused gnused
unixtools.column unixtools.column
]; ];
};
in
{
packages.x86_64-linux.default = shellApplication;
devShells.x86_64-linux.default = pkgs.mkShell {
packages = [ shellApplication ];
};
}; };
} in {
packages.x86_64-linux.default = shellApplication;
devShells.x86_64-linux.default = pkgs.mkShell {
packages = [ shellApplication ];
};
};
}