Compare commits

...

4 commits

10 changed files with 61 additions and 32 deletions

16
flake.lock generated
View file

@ -191,11 +191,11 @@
"quickshell": "quickshell"
},
"locked": {
"lastModified": 1737926462,
"narHash": "sha256-Had8OFwvM352uYd5cEdKycW//fLXQz+X/MSZFbi2FcA=",
"lastModified": 1738357726,
"narHash": "sha256-AThPO3TqwB8B0mzx5WTJpyFoxMQ0+dc36MQy6RI46ms=",
"ref": "refs/heads/main",
"rev": "d528b78753d5bd3d8f4234d130054579a5cec78c",
"revCount": 101,
"rev": "47db00f317a2a2d77330b1497f6d855b7c80a0c3",
"revCount": 103,
"type": "git",
"url": "https://git.ccnlc.eu/nydragon/nysh.git"
},
@ -233,11 +233,11 @@
]
},
"locked": {
"lastModified": 1734739124,
"narHash": "sha256-IixrzTK4Xzc51BC+6hh0HUm/i9SXcYJaIYAN883ErzE=",
"lastModified": 1738200090,
"narHash": "sha256-Pod1QURdjB2BMujrkhmmSOWSdebgt1mwEG5iLT+n4AI=",
"ref": "refs/heads/master",
"rev": "2f194b78949ccf3a8011c58f7eb39324ff936443",
"revCount": 442,
"rev": "fb326e0e9c66b30874d63bfe53eaf2176fbba1f1",
"revCount": 481,
"type": "git",
"url": "https://git.outfoxxed.me/quickshell/quickshell"
},

View file

@ -59,6 +59,8 @@ lib.mkIf osConfig.programs.sway.enable {
keybindings =
let
mod = config.wayland.windowManager.sway.config.modifier;
cliphist = getExe pkgs.cliphist;
copy = getExe' pkgs.wl-clipboard "wl-copy";
in
lib.mkOptionDefault {
"${mod}+p" = "exec ${getExe pkgs.hyprlock}";
@ -73,10 +75,6 @@ lib.mkIf osConfig.programs.sway.enable {
# Start launcher
"${mod}+d" = "exec ${getExe desktop.runner.package}";
"${mod}+s" =
let
cliphist = getExe pkgs.cliphist;
copy = getExe' pkgs.wl-clipboard "wl-copy";
in
mkIf cliphistEnabled "exec ${cliphist} list | ${desktop.runner.dmenu} | ${cliphist} decode | ${copy}";
# Toggle the current focus between tiling and floating mode
"${mod}+Shift+space" = "floating toggle";
@ -88,18 +86,17 @@ lib.mkIf osConfig.programs.sway.enable {
"${mod}+n" = "exec nysh msg dash toggle";
"--locked XF86MonBrightnessUp" = "exec --no-startup-id ${getExe pkgs.brightnessctl} s +10%";
"--locked XF86MonBrightnessDown" = "exec --no-startup-id ${getExe pkgs.brightnessctl} s 10%-";
"--locked XF86AudioRaiseVolume" = "exec --no-startup-id ${getExe pkgs.pamixer} -i 5";
"--locked XF86AudioLowerVolume" = "exec --no-startup-id ${getExe pkgs.pamixer} -d 5";
"--locked XF86AudioMicMute" = "exec --no-startup-id ${getExe pkgs.pamixer} --default-source -m";
"--locked XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t";
"--locked XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"--locked XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"--locked XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"--locked XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"--locked XF86AudioRaiseVolume" = "exec --no-startup-id ${getExe pkgs.pw-volume} change +5%";
"--locked XF86AudioLowerVolume" = "exec --no-startup-id ${getExe pkgs.pw-volume} change -5%";
"--locked XF86AudioMute" = "exec --no-startup-id ${getExe pkgs.pw-volume} mute toggle";
"--locked XF86AudioPlay" = "exec ${getExe pkgs.playerctl} play-pause";
"--locked XF86AudioPause" = "exec ${getExe pkgs.playerctl} play-pause";
"--locked XF86AudioNext" = "exec ${getExe pkgs.playerctl} next";
"--locked XF86AudioPrev" = "exec ${getExe pkgs.playerctl} previous";
"${mod}+u" =
"exec ${getExe pkgs.hyprshot} -o ${config.xdg.userDirs.pictures}/screenshots -m region";
"${mod}+Shift+u" =
"exec ${getExe pkgs.hyprshot} --raw -m region | ${getExe pkgs.satty} -f - --fullscreen";
"exec ${getExe pkgs.hyprshot} --raw -m region | ${getExe pkgs.satty} -f - --fullscreen --copy-command ${copy}";
#: Workspace movement {{{
"--input-device=${inputs.kb.builtin} ${mod}+ampersand" = "workspace number 1";

View file

@ -1,10 +1,12 @@
# vim:fileencoding=utf-8:foldmethod=marker
{
pkgs,
username,
config,
...
}:
let
inherit (config.modules.meta) username;
in
{
imports = [
./hardware-configuration.nix

View file

@ -1,10 +1,12 @@
{
pkgs,
username,
config,
inputs,
...
}:
let
inherit (config.modules.meta) username;
in
{
imports = [
../../modules/home-manager.nix

View file

@ -7,10 +7,12 @@ let
name = sys.hostname;
value = mkSystem ({ inherit withSystem; } // sys);
};
username = "ny";
in
{
flake.nixosConfigurations = listToAttrs [
(mkSystem' {
inherit username;
hostname = "marr";
system = "x86_64-linux";
extraModules = [
@ -20,12 +22,14 @@ in
})
(mkSystem' {
inherit username;
hostname = "brontes";
system = "x86_64-linux";
extraModules = [ inputs.agenix.nixosModules.default ];
})
(mkSystem' {
inherit username;
hostname = "shan";
system = "x86_64-linux";
extraModules = [
@ -35,6 +39,7 @@ in
})
(mkSystem' {
inherit username;
hostname = "raptus";
system = "x86_64-linux";
extraModules = [
@ -44,6 +49,7 @@ in
})
(mkSystem' {
inherit username;
hostname = "nihilus";
system = "aarch64-linux";
extraModules = [

View file

@ -1,10 +1,13 @@
# vim:fileencoding=utf-8:foldmethod=marker
{
config,
pkgs,
inputs,
username,
...
}:
let
inherit (config.modules.meta) username;
in
{
imports = [
./hardware-configuration.nix

View file

@ -1,10 +1,12 @@
{
username,
pkgs,
config,
inputs,
...
}:
let
inherit (config.modules.meta) username;
in
{
imports = [
../../modules/home-manager.nix

View file

@ -1,4 +1,7 @@
{ username, pkgs, ... }:
{ config, pkgs, ... }:
let
inherit (config.modules.meta) username;
in
{
users.users.${username} = {
isNormalUser = true;

View file

@ -1,14 +1,28 @@
{ lib, ... }:
let
inherit (lib) mkOption;
inherit (lib.types) nullOr str;
inherit (lib) mkOption stringLength;
inherit (lib.types) str strMatching;
validateUserName =
x:
assert (
stringLength x < 32 || abort "Username '${x}' is longer than 31 characters which is not allowed!"
);
x;
in
{
options.modules.meta = {
hostname = mkOption {
default = null;
type = nullOr str;
type = strMatching "^[[:alnum:]]([[:alnum:]_-]{0,61}[[:alnum:]])?$";
default = "";
description = "The system's hostname.";
};
username = mkOption {
default = "";
type = str;
apply = validateUserName;
# Should handle multiple users one day? maybe...
description = "This system's primary user.";
};
};
}

View file

@ -32,6 +32,7 @@ in
{
withSystem,
hostname,
username,
extraModules ? [ ],
system,
}:
@ -43,13 +44,12 @@ in
"${self}/hosts/${hostname}"
"${self}/options"
"${self}/modules"
{ modules.meta.hostname = hostname; }
{ modules.meta = { inherit hostname username; }; }
] ++ extraModules;
specialArgs = {
inherit inputs inputs';
inherit self self';
pubkeys = import ../../options/keys.nix { inherit lib; };
username = "ny";
};
}
);