Squash merge refactor into main

This commit is contained in:
danny 2025-08-09 22:22:19 +08:00
parent 529c9e5fa7
commit b82cd59f4f
35 changed files with 498 additions and 358 deletions

View file

@ -17,7 +17,7 @@
- [X] Hyprlock - [X] Hyprlock
- [X] Hypridle - [X] Hypridle
- [X] Swaync (Notification Center) - [X] Swaync (Notification Center)
- [X] Hyprpaper (Wallpaper) - [X] Swww (Wallpaper)
- [X] Ghostty (Terminal) - [X] Ghostty (Terminal)
- [X] SDDM (Display Manager) - [X] SDDM (Display Manager)
- [X] Fish (shell) - [X] Fish (shell)

78
flake.lock generated
View file

@ -222,6 +222,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_8": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -1290,6 +1306,22 @@
} }
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": {
"lastModified": 1753934836,
"narHash": "sha256-G06FmIBj0I5bMW1Q8hAEIl5N7IHMK7+Ta4KA+BmneDA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8679b16e11becd487b45d568358ddf9d5640d860",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1752596105, "lastModified": 1752596105,
"narHash": "sha256-lFNVsu/mHLq3q11MuGkMhUUoSXEdQjCHvpReaGP1S2k=", "narHash": "sha256-lFNVsu/mHLq3q11MuGkMhUUoSXEdQjCHvpReaGP1S2k=",
@ -1374,6 +1406,7 @@
"nix-tmodloader": "nix-tmodloader", "nix-tmodloader": "nix-tmodloader",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"swww": "swww",
"yazi": "yazi" "yazi": "yazi"
} }
}, },
@ -1399,6 +1432,27 @@
} }
}, },
"rust-overlay_2": { "rust-overlay_2": {
"inputs": {
"nixpkgs": [
"swww",
"nixpkgs"
]
},
"locked": {
"lastModified": 1753930086,
"narHash": "sha256-Os6Ta5zamfAllmQNlvkbGZLHn06zJy3hVXRk+Dy2yMo=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "17b672c10c1798696a516cb879edbc2ebd0f58a4",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_3": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"yazi", "yazi",
@ -1437,6 +1491,26 @@
"type": "github" "type": "github"
} }
}, },
"swww": {
"inputs": {
"flake-compat": "flake-compat_8",
"nixpkgs": "nixpkgs_7",
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1754041947,
"narHash": "sha256-KzuedC2yJU56sRBeMlndPuXK6UWHxSUtgAmJ/+Gww6I=",
"owner": "LGFae",
"repo": "swww",
"rev": "63d71f2b8c6d1533b5fef748dfc490dd461e343c",
"type": "github"
},
"original": {
"owner": "LGFae",
"repo": "swww",
"type": "github"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
@ -1622,8 +1696,8 @@
"yazi": { "yazi": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_8",
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay_3"
}, },
"locked": { "locked": {
"lastModified": 1753281791, "lastModified": 1753281791,

101
flake.nix
View file

@ -81,6 +81,10 @@
url = "github:hyprwm/hyprlock"; url = "github:hyprwm/hyprlock";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
swww = {
url = "github:LGFae/swww";
};
}; };
outputs = outputs =
@ -111,70 +115,25 @@
}; };
}; };
# Declaring All Devices
devices = { devices = {
# Home Computer
dn-pre7780 = { dn-pre7780 = {
settings = {
personal = {
hostname = "dn-pre7780"; hostname = "dn-pre7780";
domain = "net.dn"; domain = "net.dn";
username = "danny"; username = "danny";
git = {
username = "DACHXY";
email = "Danny10132024@gmail.com";
};
};
hyprland = {
# Leave empty if you only have one monitor
# This is for assign workspace to a specific monitor
# e.g. 1, 3, 5 for the first one; 2, 4, 6 for the second one
monitors = [
"desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271"
"desc:Acer Technologies XV272U V3 1322131231233"
];
cursor-size = 32;
xcursor-size = 24;
};
# Optional
nvidia = {
# Choose from offload, sync, rsync
mode = "offload";
# Only needed when using GPU hybrid mode
intel-bus-id = "PCI:0:2:0";
nvidia-bus-id = "PCI:1:0:0";
};
};
extra-modules = [ extra-modules = [
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
./system/dev/dn-pre7780 ./system/dev/dn-pre7780
]; ];
overlays = [ overlays = [ ];
];
}; };
# Laptop
dn-lap = { dn-lap = {
settings = {
personal = {
hostname = "dn-lap"; hostname = "dn-lap";
username = "danny"; username = "danny";
git = { domain = "net.dn";
username = "DACHXY";
email = "Danny10132024@gmail.com";
};
};
hyprland = {
# Leave empty if you only have one monitor
# This is for assign workspace to a specific monitor
# e.g. 1, 3, 5 for the first one; 2, 4, 6 for the second one
monitors = [ ];
cursor-size = 32;
xcursor-size = 24;
};
};
extra-modules = [ extra-modules = [
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
./system/dev/dn-lap ./system/dev/dn-lap
@ -184,36 +143,11 @@
]; ];
}; };
# Server
dn-server = { dn-server = {
settings = {
personal = {
hostname = "dn-server"; hostname = "dn-server";
username = "danny"; username = "danny";
git = { domain = "net.dn";
username = "DACHXY";
email = "Danny10132024@gmail.com";
};
};
hyprland = {
# Leave empty if you only have one monitor
# This is for assign workspace to a specific monitor
# e.g. 1, 3, 5 for the first one; 2, 4, 6 for the second one
monitors = [ ];
cursor-size = 32;
xcursor-size = 24;
};
# Optional
nvidia = {
# Choose from offload, sync, rsync
mode = "offload";
# Only needed when using GPU hybrid mode
intel-bus-id = "PCI:0:2:0";
nvidia-bus-id = "PCI:1:0:0";
};
};
extra-modules = [ extra-modules = [
inputs.nix-minecraft.nixosModules.minecraft-servers inputs.nix-minecraft.nixosModules.minecraft-servers
inputs.nix-tmodloader.nixosModules.tmodloader inputs.nix-tmodloader.nixosModules.tmodloader
@ -230,9 +164,7 @@
nixosConfigurations = builtins.mapAttrs ( nixosConfigurations = builtins.mapAttrs (
dev: conf: dev: conf:
let let
settings = conf.settings; inherit (conf) username hostname domain;
username = settings.personal.username;
hostname = settings.personal.hostname;
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
modules = [ modules = [
@ -247,8 +179,8 @@
inputs inputs
system system
nix-version nix-version
settings
devices devices
username
; ;
}; };
users."${username}" = { users."${username}" = {
@ -265,7 +197,10 @@
]; ];
}; };
}; };
networking.hostName = hostname; networking = {
inherit domain;
hostName = hostname;
};
nixpkgs.hostPlatform = system; nixpkgs.hostPlatform = system;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = ((import ./pkgs/overlays) ++ conf.overlays); nixpkgs.overlays = ((import ./pkgs/overlays) ++ conf.overlays);
@ -274,7 +209,7 @@
++ common-settings.modules ++ common-settings.modules
++ conf.extra-modules; ++ conf.extra-modules;
specialArgs = { specialArgs = {
inherit settings; inherit username;
} }
// common-settings.args; // common-settings.args;
} }

View file

@ -2,6 +2,7 @@
terminal, terminal,
osConfig, osConfig,
wallRand, wallRand,
rofiWall,
pkgs, pkgs,
lib, lib,
}: }:
@ -11,6 +12,7 @@ let
terminal terminal
osConfig osConfig
wallRand wallRand
rofiWall
pkgs pkgs
lib lib
; ;
@ -19,7 +21,7 @@ in
map (dev: dev // modulesConfig) [ map (dev: dev // modulesConfig) [
# Monitor 1 # Monitor 1
{ {
output = "DP-6"; output = "DP-5";
layer = "top"; layer = "top";
exclusive = true; exclusive = true;
passthrough = false; passthrough = false;
@ -67,7 +69,7 @@ map (dev: dev // modulesConfig) [
} }
# Monitor 2 # Monitor 2
{ {
output = "DP-5"; output = "DP-6";
layer = "top"; layer = "top";
exclusive = true; exclusive = true;
height = 54; height = 54;

View file

@ -3,6 +3,7 @@
osConfig, osConfig,
wallRand, wallRand,
pkgs, pkgs,
rofiWall,
lib, lib,
}: }:
let let
@ -268,7 +269,8 @@ in
}; };
"custom/wallRand" = { "custom/wallRand" = {
format = ""; format = "";
on-click = "${wallRand}/bin/wallRand"; on-click = "${rofiWall}";
on-click-right = "${wallRand}";
}; };
"custom/airplay" = "custom/airplay" =
let let

View file

@ -5,9 +5,7 @@
../user/desktops.nix ../user/desktops.nix
../user/direnv.nix ../user/direnv.nix
../user/environment.nix ../user/environment.nix
../user/git.nix
../user/gtk.nix ../user/gtk.nix
../user/hyprland.nix
# ../user/music-production.nix # ../user/music-production.nix
../user/nvim.nix ../user/nvim.nix
../user/packages.nix ../user/packages.nix

View file

@ -1,9 +1,13 @@
{ settings, ... }: {
username,
email,
}:
{ ... }:
{ {
programs.git = { programs.git = {
enable = true; enable = true;
userName = settings.personal.git.username; userName = username;
userEmail = settings.personal.git.email; userEmail = email;
extraConfig = { extraConfig = {
safe.directory = [ "/etc/nixos" ]; safe.directory = [ "/etc/nixos" ];
init.defaultBranch = "main"; init.defaultBranch = "main";

View file

@ -1,12 +1,10 @@
{ {
pkgs, pkgs,
settings,
... ...
}: }:
let let
cursorName = "catppuccin-macchiato-lavender-cursors"; cursorName = "catppuccin-macchiato-lavender-cursors";
themeName = "catppuccin-macchiato-lavender-compact"; themeName = "catppuccin-macchiato-lavender-compact";
cursorSize = settings.hyprland.xcursor-size;
in in
{ {
gtk = { gtk = {
@ -15,7 +13,6 @@ in
cursorTheme = { cursorTheme = {
name = cursorName; name = cursorName;
package = pkgs.catppuccin-cursors.macchiatoLavender; package = pkgs.catppuccin-cursors.macchiatoLavender;
size = cursorSize;
}; };
theme = { theme = {

View file

@ -1,8 +1,9 @@
{ {
settings,
mainMod, mainMod,
nvidia-offload-enabled, nvidia-offload-enabled,
pkgs, pkgs,
rofiWall,
monitors ? [ ],
}: }:
with builtins; with builtins;
let let
@ -11,9 +12,7 @@ let
browser = "${prefix} ${firefox}"; browser = "${prefix} ${firefox}";
terminal = "ghostty"; terminal = "ghostty";
filemanager = "${terminal} -e yazi"; filemanager = "${terminal} -e yazi";
scripts = "~/.config/scripts";
freezeShot = "";
screenshotFolder = "--output-folder ~/Pictures/Screenshots"; screenshotFolder = "--output-folder ~/Pictures/Screenshots";
clipboardOnly = "${screenshotFolder}"; clipboardOnly = "${screenshotFolder}";
@ -27,20 +26,9 @@ let
fi fi
''; '';
toggleRofi = pkgs.writeShellScriptBin "toggle" ''
GDK_PIXBUF_MODULE_FILE="${pkgs.librsvg}/lib/gdk-pixbuf-2.0/${pkgs.librsvg.version}/loaders.cache" # Make rofi load svg
if ${pkgs.busybox}/bin/pgrep rofi > /dev/null; then
${pkgs.busybox}/bin/pkill rofi
else
rofi "$@"
fi
'';
scrollStep = scrollStep =
let let
monitorsNum = length settings.hyprland.monitors; monitorsNum = length monitors;
in in
toString (if (monitorsNum == 0) then 1 else monitorsNum); toString (if (monitorsNum == 0) then 1 else monitorsNum);
in in
@ -53,19 +41,20 @@ in
''${mainMod}, M, exec, ${toggleWlogout}/bin/toggle'' ''${mainMod}, M, exec, ${toggleWlogout}/bin/toggle''
''${mainMod}, E, exec, ${filemanager}'' ''${mainMod}, E, exec, ${filemanager}''
''${mainMod}, V, togglefloating, '' ''${mainMod}, V, togglefloating, ''
''ALT, SPACE, exec, ${toggleRofi}/bin/toggle -config ~/.config/rofi/apps.rasi -show drun'' ''ALT, SPACE, exec, rofi -config ~/.config/rofi/apps.rasi -show drun''
''${mainMod}, W, exec, ${rofiWall}''
''${mainMod}, P, pseudo, # dwindle'' ''${mainMod}, P, pseudo, # dwindle''
''${mainMod}, S, togglesplit, # dwindle'' ''${mainMod}, S, togglesplit, # dwindle''
''CTRL ${mainMod} SHIFT, L, exec, hyprlock'' ''CTRL ${mainMod} SHIFT, L, exec, hyprlock''
# Screenshot # Screenshot
''${mainMod} SHIFT, s, exec, hyprshot -m region ${clipboardOnly} ${freezeShot}'' ''${mainMod} SHIFT, s, exec, hyprshot -m region ${clipboardOnly}''
''CTRL SHIFT, s, exec, hyprshot -m window ${clipboardOnly} ${freezeShot}'' ''CTRL SHIFT, s, exec, hyprshot -m window ${clipboardOnly}''
''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output ${clipboardOnly} ${freezeShot}'' ''CTRL SHIFT ${mainMod}, s, exec, hyprshot -m output ${clipboardOnly}''
''CTRL ALT, s, exec, hyprshot -m active -m window ${clipboardOnly} ${freezeShot}'' ''CTRL ALT, s, exec, hyprshot -m active -m window ${clipboardOnly}''
''${mainMod}, PERIOD, exec, ${toggleRofi}/bin/toggle -modi emoji -show emoji'' ''${mainMod}, PERIOD, exec, rofi -modi emoji -show emoji''
''CTRL ${mainMod}, c, exec, ${toggleRofi}/bin/toggle -show calc -modi calc -no-show-match -no-sort'' ''CTRL ${mainMod}, c, exec, rofi -show calc -modi calc -no-show-match -no-sort''
''${mainMod}, X, exec, sleep 0.1 && swaync-client -t -sw'' ''${mainMod}, X, exec, sleep 0.1 && swaync-client -t -sw''
''${mainMod} SHIFT, C, centerwindow'' ''${mainMod} SHIFT, C, centerwindow''
'',F11, fullscreen'' '',F11, fullscreen''
@ -102,10 +91,6 @@ in
''${mainMod}, G, workspace, ${toString gamingWorkspace}'' ''${mainMod}, G, workspace, ${toString gamingWorkspace}''
''${mainMod} SHIFT, G, movetoworkspace, ${toString gamingWorkspace}'' ''${mainMod} SHIFT, G, movetoworkspace, ${toString gamingWorkspace}''
# ==== Plugins ==== #
# Overview
# ''${mainMod}, o, hyprtasking:toggle, cursor''
# ''${mainMod}, TAB, hyprtasking:toggle, all''
] ]
++ ( ++ (
# workspaces # workspaces

View file

@ -1,16 +0,0 @@
{ mainMod }:
let
resizeStep = builtins.toString 20;
brightnessStep = builtins.toString 10;
volumeStep = builtins.toString 2;
in
[
'',XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%+''
'',XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%-''
'',XF86MonBrightnessDown, exec, brightnessctl set ${brightnessStep}%-''
'',XF86MonBrightnessUp, exec, brightnessctl set ${brightnessStep}%+''
''${mainMod} CTRL, l, resizeactive, ${resizeStep} 0''
''${mainMod} CTRL, h, resizeactive, -${resizeStep} 0''
''${mainMod} CTRL, k, resizeactive, 0 -${resizeStep}''
''${mainMod} CTRL, j, resizeactive, 0 ${resizeStep}''
]

View file

@ -1,6 +0,0 @@
{ mainMod }:
[
# Move/resize windows with mainMod + LMB/RMB and dragging
''${mainMod}, mouse:272, movewindow''
''${mainMod}, mouse:273, resizewindow''
]

View file

@ -1,17 +0,0 @@
{
pkgs,
terminal,
xcursor-size,
...
}:
let
startupScript = pkgs.writeShellScriptBin "start" ''
# Fix nemo open in terminal
dconf write /org/cinnamon/desktop/applications/terminal/exec "''\'${terminal}''\'" &
dconf write /org/cinnamon/desktop/applications/terminal/exec-arg "''\'''\'" &
dconf write /org/gnome/desktop/interface/cursor-size ${builtins.toString xcursor-size} &
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME &
'';
in
''${startupScript}/bin/start''

View file

@ -9,7 +9,7 @@
follow_mouse = 1; follow_mouse = 1;
accel_profile = "flat"; accel_profile = "flat";
kb_options = [ "caps:swapescape" ]; kb_options = [ "caps:escape" ];
touchpad = { touchpad = {
natural_scroll = true; natural_scroll = true;

View file

@ -1,5 +0,0 @@
[
''desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271, 2560x1440@165, 0x0, 1''
''desc:Acer Technologies XV272U V3 1322131231233, 2560x1440@180, -1440x-600, 1, transform, 1''
''desc:LG Display 0x0665, preferred, 0x0, 1.25''
]

View file

@ -1,35 +0,0 @@
{
# hyprtasking = {
# layout = "grid";
# bg_color = "0xffebdbb2";
#
# gap_size = 20;
#
# gestures = {
# enabled = true;
# open_fingers = 3;
# open_distance = 300;
# open_positive = true;
# };
#
# linear = {
# height = 400;
# scroll_speed = 1.1;
# blur = 0;
# };
# };
hyprwinrap = {
class = "kitty-bg";
};
touch_gestures = {
sensitivity = 4.0;
workspace_swipe_fingers = 3;
workspace_swipe_edge = "d";
long_press_delay = 400;
resize_on_border_long_press = true;
edge_margin = 10;
emulate_touchpad_swipe = false;
};
}

View file

@ -1,7 +1,3 @@
{ lib, settings }:
let
inherit (lib) optionalString;
in
{ {
windowrule = [ windowrule = [
"pseudo, class:fcitx" "pseudo, class:fcitx"
@ -42,38 +38,21 @@ in
"float, class: ^(org.pulseaudio.pavucontrol)$" "float, class: ^(org.pulseaudio.pavucontrol)$"
"pin, class: ^(org.pulseaudio.pavucontrol)$" "pin, class: ^(org.pulseaudio.pavucontrol)$"
"animation slide top 20%, class: ^(org.pulseaudio.pavucontrol)$" "animation slide top 20%, class: ^(org.pulseaudio.pavucontrol)$"
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "move 1680 59, class: ^(org.pulseaudio.pavucontrol)$")
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "size 868 561, class: ^(org.pulseaudio.pavucontrol)$")
# Local Send (File Sharing) # Local Send (File Sharing)
"float, class: ^(localsend_app)$" "float, class: ^(localsend_app)$"
"pin, class: ^(localsend_app)$" "pin, class: ^(localsend_app)$"
"animation slide right 20%, class: ^(localsend_app)$" "animation slide right 20%, class: ^(localsend_app)$"
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "size 523 1372, class: ^(localsend_app)$")
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "move 2024 56, class: ^(localsend_app)$")
# Airplay # Airplay
"pseudo, class: ^(GStreamer)$" "pin, class: ^(GStreamer)$"
"float, class: ^(GStreamer)$"
"opacity 1.0, class: ^(GStreamer)$" "opacity 1.0, class: ^(GStreamer)$"
(optionalString (settings.personal.hostname == "dn-pre7780") "size 487 1055, class: ^(GStreamer)$") "animation slide right 20%, class: ^(GStreamer)$"
# Bluetooth # Bluetooth
"float, class: ^(blueberry.py)$" "float, class: ^(blueberry.py)$"
"pin, class: ^(blueberry.py)$" "pin, class: ^(blueberry.py)$"
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "move 1943 59, class: ^(blueberry.py)$")
(optionalString (
settings.personal.hostname == "dn-pre7780"
) "size 605 763, class: ^(blueberry.py)$")
"animation slide top 20%, class: ^(blueberry.py)$" "animation slide top 20%, class: ^(blueberry.py)$"
# Steam # Steam
@ -90,8 +69,11 @@ in
# VLC # VLC
"workspace: 3, initialClass: ^(vlc), floating: 0" "workspace: 3, initialClass: ^(vlc), floating: 0"
# vesktop # discord
"workspace: 4 silent, initialClass: ^(vesktop), floating: 0" "workspace: 4 silent, initialClass: ^(discord), floating: 0"
# Davinci resolve
"center 1, initialClass: ^(resolve), floating: 1"
]; ];
layerrule = [ layerrule = [

View file

@ -1,14 +1,20 @@
{ monitors }: { monitors }:
let let
monitorNum = builtins.length monitors; inherit (builtins)
length
genList
toString
elemAt
;
monitorNum = length monitors;
workspaceNum = 10; workspaceNum = 10;
workspaceList = builtins.genList ( workspaceList = genList (
index: index:
let let
currentNum = index - (monitorNum * (index / monitorNum)); currentNum = index - (monitorNum * (index / monitorNum));
default = if index < monitorNum then "true" else "false"; default = if index < monitorNum then "true" else "false";
in in
"${builtins.toString (index + 1)}, monitor:${builtins.elemAt monitors currentNum}, default:${default}" "${toString (index + 1)}, monitor:${elemAt monitors currentNum}, default:${default}"
) workspaceNum; ) workspaceNum;
in in
if (monitorNum > 0) then workspaceList else [ ] if (monitorNum > 0) then workspaceList else [ ]

View file

@ -1,66 +1,59 @@
{
monitors ? [ ],
}:
{ {
pkgs, pkgs,
lib, lib,
inputs, inputs,
config, config,
system, system,
username,
osConfig, osConfig,
settings,
... ...
}: }:
let let
terminal = "ghostty"; terminal = "ghostty";
startScript = import ./hypr/exec.nix {
inherit
pkgs
terminal
;
xcursor-size = settings.hyprland.xcursor-size;
};
mainMod = "SUPER";
window = import ./hypr/window.nix;
windowrule = import ./hypr/windowrule.nix { inherit lib settings; };
input = import ./hypr/input.nix;
plugins = import ./hypr/plugin.nix;
cursorName = "catppuccin-macchiato-lavender-cursors";
getCurrentSong = pkgs.writeShellScriptBin "getSong" '' execOnceScript = pkgs.writeShellScript "hyprlandExecOnce" ''
# Fix nemo open in terminal
dconf write /org/cinnamon/desktop/applications/terminal/exec "''\'${terminal}''\'" &
dconf write /org/cinnamon/desktop/applications/terminal/exec-arg "''\'''\'" &
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP QT_QPA_PLATFORMTHEME &
'';
mainMod = "SUPER";
getCurrentSong = pkgs.writeShellScript "getSong" ''
song_info=$(playerctl metadata --format '{{title}} 󰎆 {{artist}}') song_info=$(playerctl metadata --format '{{title}} 󰎆 {{artist}}')
echo "$song_info" echo "$song_info"
''; '';
wallpapers = [ mkWall = pkgs.writeShellScriptBin "setWall" ''
(pkgs.fetchurl { url="$1"
url = "https://files.net.dn/dennis-yu-fVadSuPPE8M-unsplash.jpg"; filepath="/tmp/wall_cache/$(echo -n "$url" | base64 | tr -d '\n')"
hash = "sha256-YCusefLnTntOZAh2fIoWuJbm1+iE+RNeWTbn22UDjSU=";
}) if [[ ! -f "$filepath" ]]; then
(pkgs.fetchurl { curl -sL "$url" -o "$filepath"
url = "https://files.net.dn/karsten-winegeart-LZRZJam4Avg-unsplash.jpg"; fi
hash = "sha256-NpJhRJRiFCFmdDP/8FDmzIBellSdJ1Y6Pz63QJzkPMk=";
}) ${config.services.swww.package}/bin/swww img "$filepath" \
(pkgs.fetchurl { --transition-fps 45 \
url = "https://files.net.dn/nick-design-q3s4a7FZgjY-unsplash.jpg"; --transition-duration 1 \
hash = "sha256-kJajqRuf+ZMTaORKKK4A+8MNzGd2SHjMcRYnq9T8LmA="; --transition-type random
}) '';
(pkgs.fetchurl {
url = "https://files.net.dn/oleg-demakov-zEIApnww3fU-unsplash.jpg"; rofiWall = pkgs.writeShellScript "rofiWall" ''
hash = "sha256-79JRnxJdCZOh2u8+5LcUDGjzwE1mMM2ZHrKLn36wd40="; url=$(rofi -i -dmenu -config ~/.config/rofi/config.rasi -p "URL")
}) ${mkWall}/bin/setWall "$url"
"$HOME/.config/wallpapers/wall.png" '';
];
# Change Wallpaper # Change Wallpaper
wallRand = pkgs.writeShellScriptBin "wallRand" ( wallRand = pkgs.writeShellScript "wallRand" ''
with builtins; mapfile -t wallpapers < <(find /tmp/wall_cache -type f)
let
pathString = concatStringsSep " " (map (w: "\"" + w + "\"") wallpapers);
in
''
wallpapers=(
${pathString}
)
count="''${#wallpapers[@]}" count="''${#wallpapers[@]}"
random_index=$(( RANDOM % count )) random_index=$(( RANDOM % count ))
selected="''${wallpapers[$random_index]}" selected="''${wallpapers[$random_index]}"
@ -69,15 +62,20 @@ let
exit 1 exit 1
fi fi
${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ",$selected" ${config.services.swww.package}/bin/swww img $selected --transition-fps 45 --transition-duration 1 --transition-type random
'' '';
);
in in
{ {
# For wallpapers
systemd.user.tmpfiles.rules = [
"d /tmp/wall_cache 700 ${username} -"
];
home.packages = with pkgs; [ home.packages = with pkgs; [
mpvpaper # Video Wallpaper mpvpaper # Video Wallpaper
hyprcursor hyprcursor
libnotify libnotify
mkWall
]; ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
@ -102,30 +100,72 @@ in
debug = { debug = {
disable_logs = true; disable_logs = true;
}; };
bind = import ./hypr/bind.nix { bind = import ./hypr/bind.nix {
inherit settings; inherit
inherit mainMod; mainMod
inherit pkgs; pkgs
monitors
rofiWall
;
nvidia-offload-enabled = osConfig.hardware.nvidia.prime.offload.enableOffloadCmd; nvidia-offload-enabled = osConfig.hardware.nvidia.prime.offload.enableOffloadCmd;
}; };
bindm = import ./hypr/bindm.nix { inherit mainMod; };
binde = import ./hypr/binde.nix { inherit mainMod; }; bindm = [
monitor = import ./hypr/monitor.nix; # Move/resize windows with mainMod + LMB/RMB and dragging
plugin = plugins; ''${mainMod}, mouse:272, movewindow''
exec-once = [ ''${startScript}'' ]; ''${mainMod}, mouse:273, resizewindow''
];
binde =
let
resizeStep = builtins.toString 20;
brightnessStep = builtins.toString 10;
volumeStep = builtins.toString 2;
in
[
'',XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%+''
'',XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_SINK@ 0 && wpctl set-volume @DEFAULT_SINK@ ${volumeStep}%-''
'',XF86MonBrightnessDown, exec, brightnessctl set ${brightnessStep}%-''
'',XF86MonBrightnessUp, exec, brightnessctl set ${brightnessStep}%+''
''${mainMod} CTRL, l, resizeactive, ${resizeStep} 0''
''${mainMod} CTRL, h, resizeactive, -${resizeStep} 0''
''${mainMod} CTRL, k, resizeactive, 0 -${resizeStep}''
''${mainMod} CTRL, j, resizeactive, 0 ${resizeStep}''
];
monitor = [
", prefered, 0x0, 1"
];
plugin = {
hyprwinrap = {
class = "kitty-bg";
};
touch_gestures = {
sensitivity = 4.0;
workspace_swipe_fingers = 3;
workspace_swipe_edge = "d";
long_press_delay = 400;
resize_on_border_long_press = true;
edge_margin = 10;
emulate_touchpad_swipe = false;
};
};
exec-once = [ "${execOnceScript}" ];
env = [ env = [
''HYPRCURSOR_THEME, ${cursorName}''
''HYPRCURSOR_SIZE, ${builtins.toString settings.hyprland.cursor-size}''
''XCURSOR_THEME, ${cursorName}''
''XCURSOR_SIZE, ${builtins.toString settings.hyprland.xcursor-size}''
''XDG_CURRENT_DESKTOP, Hyprland'' ''XDG_CURRENT_DESKTOP, Hyprland''
''XDG_SESSION_DESKTOP, Hyprland'' ''XDG_SESSION_DESKTOP, Hyprland''
]; ];
workspace = import ./hypr/workspace.nix { monitors = settings.hyprland.monitors; };
workspace = (import ./hypr/workspace.nix { inherit monitors; });
} }
// window // (import ./hypr/window.nix)
// windowrule // (import ./hypr/windowrule.nix)
// input; // (import ./hypr/input.nix);
}; };
# === gamemode === # # === gamemode === #
@ -135,11 +175,17 @@ in
}; };
}; };
# === Swww === #
services.swww = {
enable = true;
package = inputs.swww.packages.${system}.swww;
};
# === hyprpaper === # # === hyprpaper === #
services.hyprpaper = { services.hyprpaper = {
enable = true; enable = false;
settings = { settings = {
preload = wallpapers; # preload = wallpapers;
wallpaper = [ ", ~/.config/wallpapers/wall.png" ]; wallpaper = [ ", ~/.config/wallpapers/wall.png" ];
splash = false; splash = false;
ipc = "on"; ipc = "on";
@ -161,11 +207,7 @@ in
let let
font = "CaskaydiaCove Nerd Font"; font = "CaskaydiaCove Nerd Font";
font2 = "SF Pro Display Bold"; font2 = "SF Pro Display Bold";
mainMonitor = mainMonitor = if ((builtins.length monitors) > 0) then builtins.elemAt monitors 0 else "";
if ((builtins.length settings.hyprland.monitors) > 0) then
builtins.elemAt settings.hyprland.monitors 0
else
"";
in in
{ {
background = { background = {
@ -226,7 +268,7 @@ in
# Current Song # Current Song
{ {
monitor = "${mainMonitor}"; monitor = "${mainMonitor}";
text = ''cmd[update:1000] echo "$(${getCurrentSong}/bin/getSong)"''; text = ''cmd[update:1000] echo "$(${getCurrentSong})"'';
color = "rgba(235, 219, 178, .75)"; color = "rgba(235, 219, 178, .75)";
font_size = 16; font_size = 16;
font_family = "${font}, ${font2}"; font_family = "${font}, ${font2}";
@ -358,6 +400,7 @@ in
terminal terminal
osConfig osConfig
wallRand wallRand
rofiWall
pkgs pkgs
lib lib
; ;

View file

@ -1,7 +1,6 @@
{ {
lib, lib,
pkgs, pkgs,
settings,
inputs, inputs,
... ...
}: }:
@ -307,14 +306,6 @@
formatting = { formatting = {
command = { "nixfmt" }, command = { "nixfmt" },
}, },
-- options = {
-- nixos = {
-- expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.${settings.personal.hostname}.options',
-- },
-- home_manager = {
-- expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."${settings.personal.username}@${settings.personal.hostname}".options',
-- }
-- }
} }
} }
} }

View file

@ -52,7 +52,8 @@ in
obsidian obsidian
# Discord # Discord
vesktop # vesktop
discord
# Dev stuff # Dev stuff
(python3.withPackages (python-pkgs: [ (python3.withPackages (python-pkgs: [

View file

@ -1,6 +1,6 @@
{ pkgs, settings, ... }: { osConfig, pkgs, ... }:
let let
shellAlias = import ./shellAlias.nix { hostname = settings.personal.hostname; }; shellAlias = import ./shellAlias.nix { hostname = osConfig.networking.hostName; };
in in
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -2,6 +2,11 @@ final: prev:
let let
discordIcon = prev.lib.readFile ../../pkgs/assets/discord.svg; discordIcon = prev.lib.readFile ../../pkgs/assets/discord.svg;
discordSplash = prev.lib.readFile ../../pkgs/assets/peepoLeave.gif.base64; discordSplash = prev.lib.readFile ../../pkgs/assets/peepoLeave.gif.base64;
hideChannels = prev.pkgs.fetchurl {
url = "https://raw.githubusercontent.com/Farcrada/DiscordPlugins/cf906b358eddfe75edba215e33020c234be514b7/Hide-Channels/HideChannels.plugin.js";
hash = "sha256-JdwKnGHMtJU1hKRlx1TXSHWUA2hT5D6vw1Ez46Hhe5c=";
};
in in
{ {
vesktop = prev.vesktop.overrideAttrs (oldAttrs: { vesktop = prev.vesktop.overrideAttrs (oldAttrs: {
@ -12,6 +17,12 @@ in
} }
); );
postPatch = ''
# Add plugins
mkdir -p src/userplugins
cp ${hideChannels} src/userplugins/hideChannels.js
'';
patches = oldAttrs.patches ++ [ patches = oldAttrs.patches ++ [
../../pkgs/patches/splash.patch ../../pkgs/patches/splash.patch
]; ];

View file

@ -1,7 +1,12 @@
{ {
settings, username,
... ...
}: }:
let
monitors = [
''desc:LG Display 0x0665''
];
in
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -17,18 +22,54 @@
]; ];
home-manager = { home-manager = {
users."${settings.personal.username}" = { users."${username}" = {
imports = [ imports = [
../../../home/presets/basic.nix ../../../home/presets/basic.nix
(import ../../../home/user/bitwarden.nix { (import ../../../home/user/bitwarden.nix {
email = "danny@dn-server.net.dn"; email = "danny@dn-server.net.dn";
baseUrl = "https://bitwarden.net.dn"; baseUrl = "https://bitwarden.net.dn";
}) })
# Hyprland
(import ../../../home/user/hyprland.nix { inherit monitors; })
{
wayland.windowManager.hyprland = {
settings = {
windowrulev2 = [
# Meidia control
"move 1680 59, class: ^(org.pulseaudio.pavucontrol)$"
"size 868 561, class: ^(org.pulseaudio.pavucontrol)$"
# Local Send (File Sharing)
"size 523 1372, class: ^(localsend_app)$"
"move 2024 56, class: ^(localsend_app)$"
# Airplay
"size 487 1055, class: ^(GStreamer)$"
# Bluetooth
"move 1943 59, class: ^(blueberry.py)$"
"size 605 763, class: ^(blueberry.py)$"
];
monitors = [
''desc:LG Display 0x0665, preferred, 0x0, 1.25''
]; ];
}; };
}; };
users.users."${settings.personal.username}".openssh.authorizedKeys.keys = [ }
# Git
(import ../../../home/user/git.nix {
inherit username;
email = "danny10132024@gmail.com";
})
];
};
};
users.users."${username}".openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSHkPa6vmr5WBPXAazY16+Ph1Mqv9E24uLIf32oC2oH danny@phone.dn" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSHkPa6vmr5WBPXAazY16+Ph1Mqv9E24uLIf32oC2oH danny@phone.dn"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJSAOufpee7f8D8ONIIGU3qsN+8+DGO7BfZnEOTYqtQ5 danny@pre7780.dn" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJSAOufpee7f8D8ONIIGU3qsN+8+DGO7BfZnEOTYqtQ5 danny@pre7780.dn"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMj/LeB3i/vca3YwGNpAjf922FgiY2svro48fUSQAjOv Shortcuts on :D" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMj/LeB3i/vca3YwGNpAjf922FgiY2svro48fUSQAjOv Shortcuts on :D"

View file

@ -1,22 +1,42 @@
{ {
pkgs, pkgs,
settings, username,
config,
lib,
... ...
}: }:
let
monitors = [
"desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271"
"desc:Acer Technologies XV272U V3 1322131231233"
];
in
{ {
networking.firewall.allowedTCPPortRanges = [
{
from = 8000;
to = 8100;
}
];
hardware.nvidia.package = lib.mkForce config.boot.kernelPackages.nvidiaPackages.stable;
imports = [ imports = [
(import ../../modules/nvidia.nix {
nvidia-mode = settings.nvidia.mode;
intel-bus-id = settings.nvidia.intel-bus-id;
nvidia-bus-id = settings.nvidia.nvidia-bus-id;
})
./hardware-configuration.nix ./hardware-configuration.nix
./boot.nix
./sops-conf.nix
../../modules/presets/basic.nix ../../modules/presets/basic.nix
# Nvidia GPU Driver
(import ../../modules/nvidia.nix {
nvidia-mode = "offload";
intel-bus-id = "PCI:0:2:0";
nvidia-bus-id = "PCI:1:0:0";
})
./boot.nix # Extra Boot Options
./sops-conf.nix # Secret
../../modules/gaming.nix ../../modules/gaming.nix
# ../../modules/secure-boot.nix # ../../modules/secure-boot.nix
../../modules/virtualization.nix (import ../../modules/virtualization.nix { inherit username; })
../../modules/wine.nix ../../modules/wine.nix
../../modules/wireguard.nix ../../modules/wireguard.nix
../../modules/localsend.nix ../../modules/localsend.nix
@ -27,16 +47,24 @@
"192.168.0.0/24" "192.168.0.0/24"
]; ];
}) })
../../modules/davinci-resolve.nix
../../modules/webcam.nix
./nginx.nix
]; ];
home-manager = { home-manager = {
users."${settings.personal.username}" = { users."${username}" = {
imports = [ imports = [
../../../home/presets/basic.nix ../../../home/presets/basic.nix
# Bitwarden client
(import ../../../home/user/bitwarden.nix { (import ../../../home/user/bitwarden.nix {
email = "danny@net.dn"; email = "danny@net.dn";
baseUrl = "https://bitwarden.net.dn"; baseUrl = "https://bitwarden.net.dn";
}) })
# Proton GE
{ {
home.file.".steam/root/compatibilitytools.d/GE-Proton10-10" = { home.file.".steam/root/compatibilitytools.d/GE-Proton10-10" = {
source = fetchTarball { source = fetchTarball {
@ -45,16 +73,55 @@
}; };
}; };
} }
# Hyprland
(import ../../../home/user/hyprland.nix { inherit monitors; })
{
wayland.windowManager.hyprland = {
settings = {
windowrulev2 = [
# Meidia control
"move 1680 59, class: ^(org.pulseaudio.pavucontrol)$"
"size 868 561, class: ^(org.pulseaudio.pavucontrol)$"
# Local Send (File Sharing)
"size 523 1372, class: ^(localsend_app)$"
"move 2024 56, class: ^(localsend_app)$"
# Airplay
"size 487 1055, class: ^(GStreamer)$"
"move 2061 203, class: ^(GStreamer)$"
# Bluetooth
"move 1943 59, class: ^(blueberry.py)$"
"size 605 763, class: ^(blueberry.py)$"
];
monitor = [
''desc:ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271, 2560x1440@165, 0x0, 1''
''desc:Acer Technologies XV272U V3 1322131231233, 2560x1440@180, -1440x-600, 1, transform, 1''
];
};
};
}
# Git
(import ../../../home/user/git.nix {
inherit username;
email = "danny10132024@gmail.com";
})
]; ];
}; };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
rustdesk rustdesk
blender
]; ];
users.users = { users.users = {
"${settings.personal.username}" = { ${username} = {
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFQA42R3fZmjb9QnUgzzOTIXQBC+D2ravE/ZLvdjoOQ danny@lap.dn" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJFQA42R3fZmjb9QnUgzzOTIXQBC+D2ravE/ZLvdjoOQ danny@lap.dn"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSHkPa6vmr5WBPXAazY16+Ph1Mqv9E24uLIf32oC2oH danny@phone.dn" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSHkPa6vmr5WBPXAazY16+Ph1Mqv9E24uLIf32oC2oH danny@phone.dn"

View file

@ -0,0 +1,24 @@
{ ... }:
{
security.acme = {
acceptTerms = true;
defaults = {
validMinDays = 2;
server = "https://10.0.0.1:${toString 8443}/acme/acme/directory";
renewInterval = "daily";
email = "danny@net.dn";
webroot = "/var/lib/acme/acme-challenge";
};
};
users.users.nginx.extraGroups = [ "acme" ];
services.nginx = {
enable = true;
enableReload = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedTlsSettings = true;
recommendedProxySettings = true;
};
}

View file

@ -1,15 +1,15 @@
{ {
pkgs, pkgs,
inputs, inputs,
settings, username,
... ...
}: }:
{ {
imports = [ imports = [
(import ../../modules/nvidia.nix { (import ../../modules/nvidia.nix {
nvidia-mode = settings.nvidia.mode; nvidia-mode = "offload";
intel-bus-id = settings.nvidia.intel-bus-id; intel-bus-id = "PCI:0:2:0";
nvidia-bus-id = settings.nvidia.nvidia-bus-id; nvidia-bus-id = "PCI:1:0:0";
}) })
./sops-conf.nix ./sops-conf.nix
./boot.nix ./boot.nix
@ -41,7 +41,7 @@
]; ];
home-manager = { home-manager = {
users."${settings.personal.username}" = { users."${username}" = {
imports = [ imports = [
../../../home/user/config.nix ../../../home/user/config.nix
../../../home/user/direnv.nix ../../../home/user/direnv.nix
@ -61,6 +61,12 @@
)) ))
]; ];
} }
# Git
(import ../../../home/user/git.nix {
inherit username;
email = "danny10132024@gmail.com";
})
]; ];
}; };
}; };

View file

@ -1,13 +1,14 @@
{ {
settings,
config, config,
pkgs, pkgs,
lib, lib,
username,
... ...
}: }:
let let
username = settings.personal.username; inherit username;
ethInterface = "enp0s31f6"; ethInterface = "enp0s31f6";
sshPorts = [ 30072 ]; sshPorts = [ 30072 ];
sshPortsString = builtins.concatStringsSep ", " (builtins.map (p: builtins.toString p) sshPorts); sshPortsString = builtins.concatStringsSep ", " (builtins.map (p: builtins.toString p) sshPorts);

View file

@ -29,7 +29,7 @@ in
after = [ "networking-online.target" ]; after = [ "networking-online.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.uxplay}/bin/uxplay ${ ExecStart = "${pkgs.uxplay}/bin/uxplay ${
optionalString (hostname != null) "-n ${hostname} -nh -hls 3" optionalString (hostname != null) "-n ${hostname} -fs -fps 60 -nh"
} -p"; } -p";
}; };
}; };

View file

@ -0,0 +1,31 @@
{
pkgs,
username,
...
}:
let
scriptBin = pkgs.writeShellScriptBin "davinci-resolve" ''
ROC_ENABLE_PRE_VEGA=1 RUSTICL_ENABLE=amdgpu,amdgpu-pro,radv,radeon DRI_PRIME=1 QT_QPA_PLATFORM=xcb ${pkgs.davinci-resolve}/bin/davinci-resolve
'';
in
{
environment.systemPackages = [
scriptBin
];
home-manager.users."${username}" = {
xdg.desktopEntries."davindi-resolve" = {
name = "Davinci Resolve";
genericName = "Video Editor";
exec = "${scriptBin}/bin/davinci-resolve";
icon = "${pkgs.davinci-resolve}/share/icons/hicolor/128x128/apps/davinci-resolve.png";
comment = "Professional video editing, color, effects and audio post-processing";
categories = [
"AudioVideo"
"AudioVideoEditing"
"Video"
"Graphics"
];
};
};
}

View file

@ -3,7 +3,7 @@
programs = { programs = {
obs-studio = { obs-studio = {
enable = true; enable = true;
enableVirtualCamera = true; enableVirtualCamera = false; # Handled by webcam.nix
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [
wlrobs wlrobs
obs-backgroundremoval obs-backgroundremoval

View file

@ -17,5 +17,6 @@
../tmux.nix ../tmux.nix
../ca.nix ../ca.nix
../sops-nix.nix ../sops-nix.nix
../gc.nix
]; ];
} }

View file

@ -1,7 +1,7 @@
{ {
settings,
lib, lib,
pkgs, pkgs,
username,
... ...
}: }:
@ -19,12 +19,13 @@
enable = true; enable = true;
packages = [ pkgs.gcr ]; packages = [ pkgs.gcr ];
}; };
openssh = { openssh = {
enable = true; enable = true;
ports = [ 22 ]; ports = [ 22 ];
settings = { settings = {
PasswordAuthentication = lib.mkDefault false; PasswordAuthentication = lib.mkDefault false;
AllowUsers = lib.mkDefault [ settings.personal.username ]; AllowUsers = lib.mkDefault [ username ];
UseDns = lib.mkDefault true; UseDns = lib.mkDefault true;
PermitRootLogin = lib.mkDefault "no"; PermitRootLogin = lib.mkDefault "no";
}; };

View file

@ -1,13 +1,12 @@
{ {
settings,
pkgs, pkgs,
lib,
config, config,
username,
... ...
}: }:
{ {
users.users.${settings.personal.username} = { users.users.${username} = {
isNormalUser = true; isNormalUser = true;
shell = pkgs.bash; # Actually fish shell = pkgs.bash; # Actually fish
extraGroups = ( extraGroups = (

View file

@ -1,5 +1,5 @@
{ username }:
{ {
settings,
pkgs, pkgs,
config, config,
... ...
@ -7,7 +7,7 @@
{ {
programs.virt-manager.enable = true; programs.virt-manager.enable = true;
users.groups.libvirtd.members = [ settings.personal.username ]; users.groups.libvirtd.members = [ username ];
virtualisation = { virtualisation = {
docker.enable = true; docker.enable = true;

17
system/modules/webcam.nix Normal file
View file

@ -0,0 +1,17 @@
# Use WebRTC to stream
{ pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
ffmpeg
v4l-utils
];
boot = {
kernelModules = [ "v4l2loopback" ];
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
};
boot.extraModprobeConfig = ''
options v4l2loopback devices=2 video_nr=1,2 card_label="OBS Cam","phone webRTC cam" exclusive_caps=1,1
'';
}