Merge pull request #3 from jsw08/desktop-option-expansion
Desktop option expansion
This commit is contained in:
commit
268fb0609f
54 changed files with 441 additions and 362 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1 +1,3 @@
|
|||
.direnv
|
||||
.pre-commit-config.yaml
|
||||
|
||||
|
|
|
|||
68
flake.lock
generated
68
flake.lock
generated
|
|
@ -145,6 +145,22 @@
|
|||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"locked": {
|
||||
"lastModified": 1733328505,
|
||||
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||
|
|
@ -158,7 +174,7 @@
|
|||
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"flake-compat_3": {
|
||||
"locked": {
|
||||
"lastModified": 1733328505,
|
||||
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||
|
|
@ -328,7 +344,7 @@
|
|||
"stylix",
|
||||
"flake-compat"
|
||||
],
|
||||
"gitignore": "gitignore",
|
||||
"gitignore": "gitignore_2",
|
||||
"nixpkgs": [
|
||||
"stylix",
|
||||
"nixpkgs"
|
||||
|
|
@ -348,7 +364,50 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks-nix": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747372754,
|
||||
"narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"git-hooks-nix",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"stylix",
|
||||
|
|
@ -549,7 +608,7 @@
|
|||
},
|
||||
"nixcord": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"systems": "systems_3",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
|
|
@ -776,6 +835,7 @@
|
|||
"agenix": "agenix",
|
||||
"dcbot": "dcbot",
|
||||
"flake-parts": "flake-parts",
|
||||
"git-hooks-nix": "git-hooks-nix",
|
||||
"guiders": "guiders",
|
||||
"hm": "hm",
|
||||
"nixcord": "nixcord",
|
||||
|
|
@ -835,7 +895,7 @@
|
|||
"base16-helix": "base16-helix",
|
||||
"base16-vim": "base16-vim",
|
||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-compat": "flake-compat_3",
|
||||
"flake-utils": "flake-utils_4",
|
||||
"git-hooks": "git-hooks",
|
||||
"gnome-shell": "gnome-shell",
|
||||
|
|
|
|||
19
flake.nix
19
flake.nix
|
|
@ -5,6 +5,7 @@
|
|||
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux"];
|
||||
imports = [
|
||||
inputs.git-hooks-nix.flakeModule
|
||||
./hosts
|
||||
];
|
||||
|
||||
|
|
@ -13,16 +14,26 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
pre-commit.settings.hooks = {
|
||||
alejandra.enable = true;
|
||||
flake-checker.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
|
||||
formatter = pkgs.alejandra;
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
pkgs.alejandra
|
||||
pkgs.git
|
||||
pkgs.statix
|
||||
];
|
||||
name = "dots";
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
};
|
||||
|
||||
formatter = pkgs.alejandra;
|
||||
shellHook = ''
|
||||
${config.pre-commit.installationScript}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -31,6 +42,10 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # build error unrelated to config.
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11-small"; # build error unrelated to config.
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
git-hooks-nix = {
|
||||
url = "github:cachix/git-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
hm = {
|
||||
url = "github:nix-community/home-manager/master";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
osConfig,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
|
|
@ -7,7 +6,7 @@
|
|||
profileName = "jsw.nixos-default";
|
||||
in {
|
||||
programs.firefox = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = true;
|
||||
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
|
||||
extraPolicies = {
|
||||
DisableFirefoxStudies = true;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
programs.mpv = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = true;
|
||||
config = {
|
||||
vo = "gpu";
|
||||
profile = "gpu-hq";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
{osConfig, ...}: {
|
||||
programs.nixcord = {
|
||||
enable = osConfig.niksos.neovim;
|
||||
|
||||
enable = true;
|
||||
discord.enable = false;
|
||||
vesktop.enable = true;
|
||||
vesktopConfig = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
osConfig,
|
||||
...
|
||||
}: {
|
||||
home.packages = lib.mkIf osConfig.niksos.desktop [
|
||||
home.packages = [
|
||||
pkgs.spotify
|
||||
pkgs.signal-desktop
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{osConfig, ...}: {
|
||||
{
|
||||
services.udiskie = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = true;
|
||||
tray = "never"; #NOTE: Don't have a bar (yet?)
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,21 +10,20 @@
|
|||
pkgs.gh
|
||||
pkgs.ripgrep
|
||||
pkgs.p7zip
|
||||
pkgs.rsync
|
||||
pkgs.usbutils
|
||||
pkgs.pciutils
|
||||
pkgs.inetutils
|
||||
pkgs.aria2
|
||||
pkgs.dua
|
||||
pkgs.file
|
||||
]
|
||||
++ lib.optionals osConfig.niksos.desktop [
|
||||
inputs.somcli.defaultPackage.${pkgs.system}
|
||||
pkgs.ffmpeg
|
||||
pkgs.gurk-rs
|
||||
pkgs.playerctl
|
||||
]
|
||||
++ lib.optionals osConfig.niksos.bluetooth [
|
||||
pkgs.ear2ctl
|
||||
]
|
||||
++ lib.optionals osConfig.niksos.portable [
|
||||
inputs.somcli.defaultPackage.${pkgs.system}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@
|
|||
|
||||
nixpkgsFromInputsPath = flake.inputs.nixpkgs.outPath or "";
|
||||
nixpkgs =
|
||||
flake.pkgs.${currentSystem}.nixpkgs
|
||||
flake.pkgs.${
|
||||
currentSystem
|
||||
}.nixpkgs
|
||||
or (
|
||||
if nixpkgsFromInputsPath != ""
|
||||
then import nixpkgsFromInputsPath {}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ in {
|
|||
programs.yazi = {
|
||||
enable = true;
|
||||
plugins = {
|
||||
full-border = yPlugins.full-border;
|
||||
inherit (yPlugins) full-border;
|
||||
mount = mkIf udisks2 yPlugins.mount;
|
||||
};
|
||||
keymap.manager.prepend_keymap =
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: {
|
||||
stylix = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = true;
|
||||
autoEnable = lib.mkDefault true;
|
||||
|
||||
image = ./background.png;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (osConfig.niksos) desktop;
|
||||
cfg = osConfig.niksos.desktop.hyprland;
|
||||
in {
|
||||
imports = [
|
||||
./fuzzel.nix
|
||||
|
|
@ -14,11 +14,12 @@ in {
|
|||
./mako.nix
|
||||
];
|
||||
|
||||
home.packages = mkIf desktop [
|
||||
home.packages = mkIf cfg [
|
||||
pkgs.wl-clipboard
|
||||
];
|
||||
|
||||
home.sessionVariables = mkIf desktop {
|
||||
home.sessionVariables = mkIf cfg {
|
||||
#FIXME: migrate to hyprconf
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: {
|
||||
programs.fuzzel = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = osConfig.niksos.desktop.hyprland;
|
||||
settings.main = {
|
||||
launch-prefix = "${lib.getExe pkgs.uwsm} app --";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
}: let
|
||||
inherit (lib) getExe;
|
||||
inherit (config.lib.stylix.colors) base0D;
|
||||
inherit (osConfig.niksos) games portable;
|
||||
|
||||
runOnce = program: "pgrep ${program} || uwsm app -- ${program}";
|
||||
uwsm = getExe pkgs.uwsm;
|
||||
|
|
@ -35,11 +36,11 @@
|
|||
nmtui = termapp "${pkgs.networkmanager}/bin/nmtui";
|
||||
|
||||
somcli = let
|
||||
interactiveSom = pkgs.writeShellScriptBin "somcli" ''
|
||||
somSleep = pkgs.writeShellScriptBin "somsleep" ''
|
||||
${getExe inputs.somcli.defaultPackage.${pkgs.system}} && sleep 5
|
||||
'';
|
||||
termSom = pkgs.writeShellScriptBin "somfoot" ''
|
||||
${foot} -a "foot-somcli" ${getExe interactiveSom}
|
||||
${foot} -a "foot-somcli" ${getExe somSleep}
|
||||
'';
|
||||
in
|
||||
appE termSom;
|
||||
|
|
@ -55,69 +56,66 @@
|
|||
in
|
||||
builtins.toString (x + 1 - (c * 10));
|
||||
in [
|
||||
"$mod, ${ws}, workspace, ${toString (x + 1)}"
|
||||
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
|
||||
"$m, ${ws}, workspace, ${toString (x + 1)}"
|
||||
"$m SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
|
||||
]
|
||||
)
|
||||
10);
|
||||
in {
|
||||
config = lib.mkIf osConfig.niksos.desktop {
|
||||
home.file.".XCompose".text = ''
|
||||
<Multi_key> <s> <h> <r> <u> <g> : "¯\\_(ツ)_/¯" # Shrug.
|
||||
'';
|
||||
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
"$mod" = "ALT";
|
||||
"$m" = "ALT";
|
||||
|
||||
bindm = [
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
"$mod ALT, mouse:272, resizewindow"
|
||||
"$m, mouse:272, movewindow"
|
||||
"$m, mouse:273, resizewindow"
|
||||
"$m ALT, mouse:272, resizewindow"
|
||||
];
|
||||
|
||||
bind =
|
||||
[
|
||||
"$mod SHIFT, E, exec, uwsm stop"
|
||||
"$mod, Q, killactive,"
|
||||
"$mod, F, fullscreen,"
|
||||
"$mod, SPACE, togglefloating,"
|
||||
"$mod, O, pseudo,"
|
||||
"$mod ALT, ,resizeactive,"
|
||||
"$m SHIFT, E, exec, uwsm stop"
|
||||
"$m, Q, killactive,"
|
||||
"$m, F, fullscreen,"
|
||||
"$m, SPACE, togglefloating,"
|
||||
"$m, O, pseudo,"
|
||||
"$m ALT, ,resizeactive,"
|
||||
|
||||
"$mod, D, exec, ${fuzzel}"
|
||||
"$mod, Return, exec, ${foot}"
|
||||
"$mod Shift, Return, exec, ${firefox}"
|
||||
"$mod, Escape, exec, ${hyprlock}"
|
||||
"$mod Shift, S, exec, ${somcli}"
|
||||
"$m, D, exec, ${fuzzel}"
|
||||
"$m, Return, exec, ${foot}"
|
||||
"$m Shift, Return, exec, ${firefox}"
|
||||
"$m, Escape, exec, ${hyprlock}"
|
||||
|
||||
"$mod, A, exec, ${pulsemixer}"
|
||||
"$mod, B, exec, ${bluetui}"
|
||||
"$mod, N, exec, ${nmtui}"
|
||||
"$m, A, exec, ${pulsemixer}"
|
||||
"$m, B, exec, ${bluetui}"
|
||||
"$m, N, exec, ${nmtui}"
|
||||
''
|
||||
$mod, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./scripts.nix {inherit pkgs;}).statusnotify})"'
|
||||
$m, S, exec, bash -c 'hyprctl notify -1 5000 "rgb(${base0D})" "$(${getExe (import ./scripts.nix {inherit pkgs;}).statusnotify})"'
|
||||
''
|
||||
|
||||
"$mod, Print, exec, ${grimblast} copy area"
|
||||
"$m, Print, exec, ${grimblast} copy area"
|
||||
", Print, exec, ${grimblast} save area - | ${swappy} -f -"
|
||||
|
||||
"$mod, h, movefocus, l"
|
||||
"$mod, l, movefocus, r"
|
||||
"$mod, k, movefocus, u"
|
||||
"$mod, j, movefocus, d"
|
||||
"$m, h, movefocus, l"
|
||||
"$m, l, movefocus, r"
|
||||
"$m, k, movefocus, u"
|
||||
"$m, j, movefocus, d"
|
||||
|
||||
"$mod SHIFT, h, movewindow, l"
|
||||
"$mod SHIFT, l, movewindow, r"
|
||||
"$mod SHIFT, k, movewindow, u"
|
||||
"$mod SHIFT, j, movewindow, d"
|
||||
"$m SHIFT, h, movewindow, l"
|
||||
"$m SHIFT, l, movewindow, r"
|
||||
"$m SHIFT, k, movewindow, u"
|
||||
"$m SHIFT, j, movewindow, d"
|
||||
]
|
||||
++ workspaces
|
||||
++ lib.optionals osConfig.niksos.games (let
|
||||
++ lib.optionals games (let
|
||||
suyu = "${appE pkgs.suyu} -ql";
|
||||
dolphin = appE pkgs.dolphin-emu;
|
||||
in [
|
||||
"Super, s, exec, ${suyu}"
|
||||
"Super, d, exec, ${dolphin}"
|
||||
]);
|
||||
])
|
||||
++ lib.optionals portable [
|
||||
"$m Shift, S, exec, ${somcli}"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
# media controls
|
||||
|
|
@ -138,5 +136,4 @@ in {
|
|||
",XF86MonBrightnessDown, exec, ${brightnessctl} s 10%-"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ in {
|
|||
];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = osConfig.niksos.desktop.hyprland;
|
||||
settings = {
|
||||
env = [
|
||||
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
||||
|
|
|
|||
|
|
@ -94,5 +94,6 @@
|
|||
"float, class:foot-somcli"
|
||||
"size >30% >30%, class:foot-somcli"
|
||||
];
|
||||
#NOTE: Also check home/wayland/hyprland/binds + system/hardware/fingerprint
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
config,
|
||||
osConfig,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (config.lib.stylix.colors) base05;
|
||||
in {
|
||||
programs.hyprlock = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = osConfig.niksos.desktop.hyprland;
|
||||
|
||||
settings = {
|
||||
general = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{osConfig, ...}: {
|
||||
services.mako = {
|
||||
enable = osConfig.niksos.desktop;
|
||||
enable = osConfig.niksos.desktop.hyprland;
|
||||
settings.defaultTimeout = 5000;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,10 @@ in {
|
|||
networking.hostName = "vm";
|
||||
|
||||
niksos = {
|
||||
desktop = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
hyprland = true;
|
||||
};
|
||||
neovim = true;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +1,39 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["xhci_pci" "ahci" "sd_mod"];
|
||||
initrd.kernelModules = [];
|
||||
kernelModules = ["kvm-intel"];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/33b7e681-d92a-40db-a172-b797591a1e2e";
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/33b7e681-d92a-40db-a172-b797591a1e2e";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/0BEA-7525";
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/0BEA-7525";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
||||
};
|
||||
swapDevices = [];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.tailscale0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,13 +13,17 @@ in {
|
|||
];
|
||||
|
||||
niksos = {
|
||||
bluetooth = true;
|
||||
fingerprint = true;
|
||||
games = true;
|
||||
desktop = true;
|
||||
bluetooth = true;
|
||||
portable = true;
|
||||
|
||||
neovim = true;
|
||||
kde = true;
|
||||
games = true;
|
||||
desktop = {
|
||||
enable = true;
|
||||
hyprland = true;
|
||||
kde = false;
|
||||
};
|
||||
};
|
||||
home-manager.users.jsw.wayland.windowManager.hyprland.settings.monitor = ["eDP-1,2880x1920@120,0x0,1.5,vrr,1"];
|
||||
|
||||
|
|
|
|||
|
|
@ -12,22 +12,25 @@
|
|||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"];
|
||||
initrd.kernelModules = [];
|
||||
kernelModules = ["kvm-amd"];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
fileSystems."/" = {
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/59540469-ecb9-4a68-829b-4cd3ad6e95c3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/83C9-84B1";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0077" "dmask=0077"];
|
||||
};
|
||||
|
||||
};
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/65190d84-4e34-4905-a317-d750591933e2";}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
{
|
||||
programs.virt-manager.enable = true;
|
||||
users.groups.libvirtd.members = ["jsw"];
|
||||
virtualisation.libvirtd.enable = true;
|
||||
virtualisation.spiceUSBRedirection.enable = true;
|
||||
|
||||
virtualisation.podman.enable = true;
|
||||
virtualisation = {
|
||||
libvirtd.enable = true;
|
||||
spiceUSBRedirection.enable = true;
|
||||
podman.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
#NOTE: This config serves as a list of all of the available options
|
||||
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
|
@ -6,9 +8,29 @@
|
|||
boot.plymouth.enable = false;
|
||||
services.fwupd.enable = false;
|
||||
|
||||
# Other stuff that's enabled by default because i'll use it but it's still bloat is (note that this list shares a lot of resources):
|
||||
# - graphics drivers (~1.8gb)
|
||||
# - networkmanager (~1.25gb)
|
||||
# - polkit (~1.25gb)
|
||||
# - other stuff.. total: 4.68gb
|
||||
niksos = {
|
||||
bluetooth = false;
|
||||
desktop = {
|
||||
enable = false;
|
||||
hyprland = false;
|
||||
kde = false;
|
||||
};
|
||||
fingerprint = false;
|
||||
games = false;
|
||||
graphics = {
|
||||
enable = false;
|
||||
intel = false;
|
||||
nvidia = false;
|
||||
};
|
||||
neovim = false;
|
||||
portable = false;
|
||||
server = false;
|
||||
};
|
||||
|
||||
#NOTE: Old info
|
||||
## Other stuff that's enabled by default because i'll use it but it's still bloat is (note that this list shares a lot of resources):
|
||||
## - graphics drivers (~1.8gb)
|
||||
## - networkmanager (~1.25gb)
|
||||
## - polkit (~1.25gb)
|
||||
## - other stuff.. total: 4.68gb
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,26 +7,27 @@
|
|||
}: {
|
||||
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "virtio_pci" "virtio_scsi" "usbhid"];
|
||||
boot = {
|
||||
initrd.availableKernelModules = ["xhci_pci" "virtio_pci" "virtio_scsi" "usbhid"];
|
||||
initrd.kernelModules = [];
|
||||
kernelModules = [];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/NIXROOT";
|
||||
fsType = "btrfs";
|
||||
options = ["noatime" "discard" "compress=zstd"];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/NIXBOOT";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
};
|
||||
swapDevices = [];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@
|
|||
./boot.nix
|
||||
./users.nix
|
||||
./defaultPackages.nix
|
||||
./networking.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@
|
|||
...
|
||||
}: {
|
||||
environment.defaultPackages = [
|
||||
pkgs.git # We need git for flakes
|
||||
pkgs.neovim
|
||||
inputs.agenix.packages.${pkgs.system}.default
|
||||
pkgs.rsync
|
||||
]; # Still have to be able to edit configs.
|
||||
environment.sessionVariables = {EDITOR = "nvim";};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
# networking configuration
|
||||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./avahi.nix
|
||||
./tailscale.nix
|
||||
./wireguard.nix
|
||||
];
|
||||
|
||||
#FIXME:
|
||||
networking = {
|
||||
# use quad9 with DNS over TLS
|
||||
nameservers = ["9.9.9.9#dns.quad9.net"];
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
imports = [
|
||||
./core
|
||||
./hardware
|
||||
./network
|
||||
./nix
|
||||
./programs
|
||||
./server
|
||||
./services
|
||||
./desktop
|
||||
];
|
||||
}
|
||||
|
|
|
|||
33
system/desktop/default.nix
Normal file
33
system/desktop/default.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
mkEO = lib.mkEnableOption;
|
||||
cfg = config.niksos.desktop;
|
||||
|
||||
inherit (lib) mkIf optional;
|
||||
in {
|
||||
imports = [
|
||||
./greetd.nix
|
||||
./hyprland.nix
|
||||
./pipewire.nix
|
||||
./plasma6.nix
|
||||
./polkit.nix
|
||||
./xdg.nix
|
||||
];
|
||||
|
||||
options.niksos.desktop = {
|
||||
enable = mkEO "enable desktop related programs.";
|
||||
hyprland = mkEO "enable hyprland related programs.";
|
||||
kde = mkEO "enable kde specialisation.";
|
||||
};
|
||||
|
||||
config.assertions = mkIf (cfg.hyprland
|
||||
|| cfg.kde) [
|
||||
{
|
||||
assertion = cfg.enable;
|
||||
message = "You need to enable desktop for the hyprland/kde module to work";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -2,8 +2,10 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf config.niksos.desktop {
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
||||
in {
|
||||
config = lib.mkIf cfg {
|
||||
# greetd display manager
|
||||
services.greetd = let
|
||||
session = {
|
||||
16
system/desktop/hyprland.nix
Normal file
16
system/desktop/hyprland.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
||||
in {
|
||||
config = lib.mkIf cfg {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Makes electron apps use wayland.
|
||||
};
|
||||
}
|
||||
|
|
@ -3,8 +3,10 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config = lib.mkIf config.niksos.desktop {
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable;
|
||||
in {
|
||||
config = lib.mkIf cfg {
|
||||
security.rtkit.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
33
system/desktop/plasma6.nix
Normal file
33
system/desktop/plasma6.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.kde;
|
||||
in {
|
||||
config = lib.mkIf cfg {
|
||||
niksos.desktop.hyprland = lib.mkForce false;
|
||||
specialisation.de.configuration = {
|
||||
services = {
|
||||
greetd = let
|
||||
session = {
|
||||
command = "${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland";
|
||||
user = "jsw";
|
||||
};
|
||||
in {
|
||||
enable = true;
|
||||
settings = {
|
||||
terminal.vt = 1;
|
||||
default_session = session;
|
||||
initial_session = session;
|
||||
};
|
||||
};
|
||||
|
||||
desktopManager.plasma6.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users.jsw.stylix.autoEnable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
22
system/desktop/polkit.nix
Normal file
22
system/desktop/polkit.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
||||
in {
|
||||
systemd.user.services.polkit-gnome-authentication-agent-1 = lib.mkIf cfg {
|
||||
description = "polkit-gnome-authentication-agent-1";
|
||||
wantedBy = ["graphical-session.target"];
|
||||
wants = ["graphical-session.target"];
|
||||
after = ["graphical-session.target"];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -3,8 +3,10 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
xdg.portal = lib.mkIf config.niksos.desktop {
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable && config.niksos.desktop.hyprland;
|
||||
in {
|
||||
xdg.portal = lib.mkIf cfg {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
config = {
|
||||
|
|
@ -10,12 +10,11 @@
|
|||
foot = lib.getExe pkgs.foot;
|
||||
in {
|
||||
options.niksos.fingerprint = mkEnableOption "fingerprint support.";
|
||||
|
||||
config = mkIf fingerprint {
|
||||
services.fprintd.enable = true;
|
||||
|
||||
home-manager.users.jsw.wayland.windowManager.hyprland.settings = mkIf desktop {
|
||||
bind = [
|
||||
home-manager.users.jsw.wayland.windowManager.hyprland.settings = mkIf desktop.hyprland {
|
||||
bind = mkIf fingerprint [
|
||||
", XF86PowerOff, exec, ${uwsm} app -- pgrep fprintd-verify && exit 0 || ${foot} -a 'foot-fprintd' sh -c 'fprintd-verify && systemctl sleep'"
|
||||
];
|
||||
windowrule = [
|
||||
|
|
|
|||
|
|
@ -5,12 +5,11 @@
|
|||
...
|
||||
}: let
|
||||
inherit (lib) optionals mkEnableOption mkDefault;
|
||||
inherit (config.niksos) graphics;
|
||||
inherit (graphics) enable;
|
||||
|
||||
graphics = config.niksos.graphics;
|
||||
enable = graphics.enable;
|
||||
nvidia = graphics.enable && graphics.nvidia;
|
||||
intel = graphics.enable && graphics.intel;
|
||||
|
||||
in {
|
||||
options.niksos.graphics = {
|
||||
enable = mkEnableOption "core graphics";
|
||||
|
|
|
|||
|
|
@ -1,72 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf optionals;
|
||||
inherit (config.networking) hostName;
|
||||
iptables = lib.getExe' pkgs.iptables "iptables";
|
||||
|
||||
port = 53;
|
||||
server = "lapserv";
|
||||
|
||||
serverCfg = {
|
||||
externalInterface = "eth0";
|
||||
privateKeyFile = config.age.secrets.wg-lapserv-private.path;
|
||||
publicKey = "aM+OrvByr63RxKsU9hu0A1lKJr8fPHifHDhBekkHR0c=";
|
||||
publicIp = "80.242.224.170";
|
||||
ip = "10.100.0.1";
|
||||
};
|
||||
deviceConfig = {
|
||||
laptop = {
|
||||
publicKey = config.age.secrets.wg-laptop-private.path;
|
||||
privateKeyFile = "1su1FfHuEYIvJLaZPwpN86kmH19d/NH/zuh9DjIOyQI=";
|
||||
ip = "10.100.0.2";
|
||||
};
|
||||
};
|
||||
|
||||
isServer = server == config.networking.hostName;
|
||||
currentConfig =
|
||||
if isServer
|
||||
then serverCfg
|
||||
else deviceConfig.${hostName};
|
||||
in {
|
||||
networking.nat = mkIf isServer {
|
||||
enable = true;
|
||||
inherit (serverCfg) externalInterface;
|
||||
internalInterfaces = ["wg0"];
|
||||
};
|
||||
networking.firewall.allowedUDPPorts = [port];
|
||||
|
||||
networking.wireguard.interfaces.wg0 = {
|
||||
inherit (currentConfig) privateKeyFile;
|
||||
|
||||
listenPort = port;
|
||||
ips = ["${currentConfig.ip}/24"];
|
||||
|
||||
peers =
|
||||
[]
|
||||
++ (optionals isServer (builtins.concatMap (x: {
|
||||
inherit (x) publicKey;
|
||||
allowedIPs = ["${x.ip}/32"];
|
||||
})
|
||||
(builtins.attrValues
|
||||
deviceConfig)))
|
||||
++ (optionals (!isServer) [
|
||||
{
|
||||
inherit (serverCfg) publicKey;
|
||||
allowedIPs = ["0.0.0.0/0"];
|
||||
endpoint = "${serverCfg.publicIp}:${builtins.toString port}";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
]);
|
||||
|
||||
postSetup = mkIf isServer ''
|
||||
${iptables} -t nat -A POSTROUTING -s 10.100.0.0/24 -o ${serverCfg.externalInterface} -j MASQUERADE
|
||||
'';
|
||||
postShutdown = mkIf isServer ''
|
||||
${iptables} -t nat -D POSTROUTING -s 10.100.0.0/24 -o ${serverCfg.externalInterface} -j MASQUERADE
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -9,9 +9,11 @@
|
|||
./nh.nix
|
||||
./nixpkgs.nix
|
||||
./substituters.nix
|
||||
./nix-index.nix
|
||||
];
|
||||
|
||||
# Really annoying message when command not found
|
||||
programs.command-not-found.enable = false;
|
||||
|
||||
# we need git for flakes
|
||||
environment.systemPackages = [pkgs.git];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
programs.command-not-found.enable = false;
|
||||
programs.nix-index = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
}
|
||||
|
|
@ -3,10 +3,6 @@
|
|||
./fish.nix
|
||||
./games.nix
|
||||
./home-manager.nix
|
||||
./hyprland.nix
|
||||
./neovim.nix
|
||||
./plasma6.nix
|
||||
./polkit.nix
|
||||
./xdg.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,17 @@
|
|||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
cfg = config.niksos.games;
|
||||
in {
|
||||
options.niksos.games = lib.mkEnableOption "gaming related stuff.";
|
||||
config = lib.mkIf config.niksos.games {
|
||||
config = lib.mkIf cfg {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.niksos.desktop.enable;
|
||||
message = "The games option needs desktop to be enabled for it to work properly (it enables home-manager).";
|
||||
}
|
||||
];
|
||||
# nixpkgs.overlays = [
|
||||
# (final: prev: let
|
||||
# version = "1.4.2";
|
||||
|
|
@ -38,7 +46,6 @@
|
|||
# });
|
||||
# })
|
||||
# ];
|
||||
users.users.jsw.packages = [pkgs.gale];
|
||||
|
||||
programs = {
|
||||
gamescope = {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
inputs,
|
||||
specialArgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.hm.nixosModules.default
|
||||
];
|
||||
|
||||
home-manager = {
|
||||
}: let
|
||||
cfg = config.niksos.desktop.enable;
|
||||
in {
|
||||
home-manager = lib.mkIf cfg {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = specialArgs;
|
||||
|
|
@ -16,5 +16,5 @@
|
|||
users.jsw = import ../../home;
|
||||
};
|
||||
|
||||
programs.dconf.enable = true; # else gtk-managed stuff won't work
|
||||
programs.dconf.enable = cfg; # else gtk-managed stuff won't work
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.niksos.desktop = lib.mkEnableOption "desktop related stuff.";
|
||||
config = lib.mkIf config.niksos.desktop {
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
environment.systemPackages = [
|
||||
#FIXME: migrated to home-manager
|
||||
pkgs.kitty # This is the default config's terminal and also my main one.
|
||||
];
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1"; # Makes electron apps use wayland.
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,16 @@
|
|||
{lib, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.niksos.neovim = lib.mkEnableOption "the neovim editor";
|
||||
# The actual config resides in NixOS/home/programs/neovim.
|
||||
|
||||
config.assertions = lib.mkIf config.niksos.neovim [
|
||||
{
|
||||
assertion = config.niksos.desktop.enable;
|
||||
message = "The neovim option needs desktop enabled to work properly (it enables home-manager).";
|
||||
}
|
||||
];
|
||||
# The actual config resides in NixOS/home/programs/neovim.
|
||||
# NOTE: This is for the customisation of the neovim editor, which uses a lot of disk space. Barebones version will be installed anyhow.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options.niksos.kde = lib.mkEnableOption "a kde specialisation. Will enable desktop settings.";
|
||||
|
||||
config.specialisation.de.configuration = lib.mkIf config.niksos.kde {
|
||||
niksos.desktop = lib.mkForce true;
|
||||
|
||||
services = {
|
||||
greetd = let
|
||||
session = {
|
||||
command = "${pkgs.kdePackages.plasma-workspace}/bin/startplasma-wayland";
|
||||
user = "jsw";
|
||||
};
|
||||
in {
|
||||
settings = lib.mkForce {
|
||||
terminal.vt = 1;
|
||||
default_session = session;
|
||||
initial_session = session;
|
||||
};
|
||||
};
|
||||
|
||||
desktopManager.plasma6.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users.jsw = {
|
||||
stylix.autoEnable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
systemd = {
|
||||
user.services.polkit-gnome-authentication-agent-1 = lib.mkIf config.niksos.desktop {
|
||||
description = "polkit-gnome-authentication-agent-1";
|
||||
wantedBy = ["graphical-session.target"];
|
||||
wants = ["graphical-session.target"];
|
||||
after = ["graphical-session.target"];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 1;
|
||||
TimeoutStopSec = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./greetd.nix
|
||||
./tailscale.nix
|
||||
./avahi.nix
|
||||
./kanata.nix
|
||||
./pipewire.nix
|
||||
./power.nix
|
||||
./ssh.nix
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue