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

@ -16,16 +16,3 @@ https://gist.github.com/FlakM/0535b8aa7efec56906c5ab5e32580adf
# Building NixOS ISO
`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

105
flake.nix
View File

@ -18,70 +18,53 @@
};
};
outputs =
{
nixpkgs,
home-manager,
install-system,
...
}@inputs:
let
system = "x86_64-linux";
host = "vm";
profile = "vm";
username = "josh";
in
{
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
modules = [
./hosts/${host}
];
outputs = { nixpkgs, home-manager, install-system, ... } @ inputs: let
system = "x86_64-linux";
host = "vm";
profile = "vm";
username = "josh";
in {
nixosConfigurations = {
nixos = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
inherit host;
inherit profile;
inherit username;
};
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}
];
};
};
devShell.${system} = nixpkgs.legacyPackages.${system}.pkgs.mkShell {
packages = with nixpkgs.legacyPackages.${system}.pkgs; [
nil
nixd
modules = [
./hosts/${host}
];
};
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

@ -14,13 +14,8 @@ 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 ]
);
environment.systemPackages = with pkgs; []
++ (if pipewireCfg.enable
then [ (wrapFirefox (firefox-unwrapped.override { pipewireSupport = true; }) {}) ]
else [ firefox ]);
}

View File

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

View File

@ -1,4 +1,5 @@
{
config,
host,
pkgs,
...

View File

@ -1,4 +1,5 @@
{
config,
pkgs,
...
}:

View File

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

View File

@ -11,7 +11,7 @@
fonts = {
emoji = {
package = pkgs.noto-fonts-emoji;
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
monospace = {

View File

@ -1,9 +1,11 @@
{
config,
lib,
...
}:
with lib;
let
cfg = config.system;
cfg = config.system;
in
{
nix = {

View File

@ -2,11 +2,13 @@
config,
host,
inputs,
lib,
pkgs,
profile,
username,
...
}:
with lib;
let
shellCfg = config.modules.shell;
in
@ -16,14 +18,7 @@ in
useUserPackages = true;
useGlobalPkgs = false;
backupFileExtension = "backup";
extraSpecialArgs = {
inherit
host
inputs
profile
username
;
};
extraSpecialArgs = { inherit host inputs profile username; };
users.${username} = {
imports = [ ./../home ];
home = {
@ -44,13 +39,10 @@ in
];
shell = pkgs.${shellCfg.defaultShell};
ignoreShellProgramCheck = true;
packages = with pkgs; [
fzf
];
};
# 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}" ];
}

View File

@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}:
with lib;

View File

@ -1,4 +1,5 @@
{
host,
...
}:
{

View File

@ -1,7 +1,9 @@
{
lib,
osConfig,
...
}:
with lib;
let
cfg = osConfig.modules.hyprland;
in

View File

@ -1,4 +1,5 @@
{
host,
lib,
osConfig,
pkgs,

View File

@ -1,4 +1,5 @@
{
config,
lib,
osConfig,
pkgs,

View File

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

View File

@ -1,9 +1,12 @@
{
config,
lib,
osConfig,
pkgs,
profile,
...
}:
with lib;
let
cfg = osConfig.modules.zsh;
xdgCfg = config.xdg;
@ -16,8 +19,7 @@ in
programs.zsh = {
enable = cfg.enable;
dotDir = "${xdgCfg.configHome}/zsh";
autosuggestion.enable = false;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting = {
enable = true;
highlighters = [
@ -29,13 +31,9 @@ in
};
historySubstringSearch.enable = true;
history = {
append = true;
ignoreDups = false;
ignoreSpace = true;
save = 100000;
share = true;
size = 100000;
extended = true;
};
initContent = ''
@ -50,16 +48,6 @@ in
# Tab to accept current selection
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 = {

View File

@ -2,6 +2,7 @@
config,
lib,
osConfig,
pkgs,
...
}:
with lib;

View File

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

View File

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

View File

@ -1,8 +1,12 @@
{
config,
lib,
...
}:
with lib;
let
cfg = config.modules.pipewire;
in
{
options.modules.pipewire = {
enable = mkEnableOption {

View File

@ -1,8 +1,12 @@
{
config,
lib,
...
}:
with lib;
let
cfg = config.modules.plasma;
in
{
options.modules.plasma = {
enable = mkEnableOption {

View File

@ -22,17 +22,11 @@ in
};
};
config.assertions =
[ ]
++ (
if cfg.defaultShell == "zsh" then
[
{
config.assertions = []
++ (if cfg.defaultShell == "zsh"
then [{
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`.";
}
]
else
[ ]
);
}]
else []);
}

View File

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

View File

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

View File

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