1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

11 Commits

13 changed files with 192 additions and 152 deletions

124
configs/applicative.nix Normal file
View File

@@ -0,0 +1,124 @@
{
config,
pkgs,
lib,
...
}:
{
users.users.applicative = {
name = "applicative";
description = "<*>";
hashedPasswordFile = config.age.secrets.kfm-password.path;
isNormalUser = true;
extraGroups = [
"pipewire"
"audio"
];
};
# to run nspawn in nix sandbox
nix.settings = {
auto-allocate-uids = true;
system-features = [ "uid-range" ];
experimental-features = [
"auto-allocate-uids"
"cgroups"
];
extra-sandbox-paths = [ "/dev/net" ]; # needed for tests of VPNs
};
services.restic.backups.niveum = {
extraBackupArgs = [
"--exclude=${config.users.users.applicative.home}/src/nixpkgs/.git"
];
paths = [
config.users.users.applicative.home
];
};
security.sudo.extraRules = [
{
# still required for systemd-nspawn
users = [ config.users.users.applicative.name ];
commands = [ "ALL" ];
}
];
home-manager.users.applicative =
let
mainGitConfig = (import ./git.nix {
inherit pkgs lib config;
}).home-manager.users.me.programs.git;
mainAlacrittyConfig = (import ./alacritty.nix {
inherit pkgs lib config;
}).home-manager.users.me.programs.alacritty;
in
lib.recursiveUpdate
(import ./graphical/home-manager.nix {
inherit lib pkgs config;
})
{
xdg.enable = true;
home.stateVersion = "25.11";
programs.git = {
enable = true;
settings = {
inherit (mainGitConfig.settings) alias;
};
};
programs.alacritty = mainAlacrittyConfig;
services.hyprpaper =
let
# asgWallpaper = pkgs.fetchurl {
# url = "http://c.krebsco.de/asg-wallpaper.png";
# hash = "sha256-XLp8XcUgFgDKW5Qae0//0Xw9lhribcevQTVSQvClEB4=";
# };
backgroundColor = config.lib.stylix.colors.withHashtag.base06;
foregroundColor = config.lib.stylix.colors.withHashtag.base01;
width = 1920;
height = 1080;
svgUrl = "https://applicative.systems/_astro/logo-full.D8zRvqBZ.svg";
logoSvg = pkgs.fetchurl {
url = svgUrl;
hash = "sha256-qXDIEZsAPn4eUJ3kb5U6L3PMUCtWGYqhqyIaBt7FntE=";
};
asgWallpaper =
pkgs.runCommand "applicative-wallpaper.png"
{
nativeBuildInputs = [ pkgs.imagemagick ];
}
''
# 1. We use -background to set the canvas color
# 2. We use -fuzz and -opaque to replace the logo's internal colors
# 3. We use -gravity and -extent to center it on a wallpaper-sized canvas
convert \
-background none \
-density 300 \
"${logoSvg}" \
-fuzz 100% -fill "${foregroundColor}" -opaque black \
-resize 800x800 \
-gravity center \
-background "${backgroundColor}" \
-extent ${toString width}x${toString height} \
$out
'';
in
{
enable = true;
settings = {
ipc = false;
splash = true;
preload = [ "${asgWallpaper}" ];
wallpaper = [ ",${asgWallpaper}" ];
};
};
};
}

View File

@@ -105,67 +105,6 @@ in
supportedLocales = [ "all" ]; supportedLocales = [ "all" ];
}; };
} }
{
# services.displayManager.cosmic-greeter.enable = false;
services.desktopManager.cosmic.enable = true;
# services.system76-scheduler.enable = true;
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-cosmic ];
};
users.users.applicative = {
name = "applicative";
description = "<*>";
hashedPasswordFile = config.age.secrets.kfm-password.path;
isNormalUser = true;
extraGroups = [
"pipewire"
"audio"
];
};
# to run nspawn in nix sandbox
nix.settings = {
auto-allocate-uids = true;
system-features = [ "uid-range" ];
experimental-features = [
"auto-allocate-uids"
"cgroups"
];
};
services.restic.backups.niveum = {
extraBackupArgs = [
"--exclude=${config.users.users.applicative.home}/src/nixpkgs/.git"
];
paths = [
config.users.users.applicative.home
];
};
security.sudo.extraRules = [
{
# still required for systemd-nspawn
users = [ config.users.users.applicative.name ];
commands = [ "ALL" ];
}
];
home-manager.users.applicative =
lib.recursiveUpdate
(import ./graphical/home-manager.nix {
inherit lib pkgs config;
})
{
xdg.enable = true;
home.stateVersion = "25.11";
services.hyprpaper.enable = false;
# programs.git = config.home-manager.users.me.programs.git;
# programs.alacritty = config.home-manager.users.me.programs.alacritty;
};
}
{ {
services.power-profiles-daemon.enable = true; services.power-profiles-daemon.enable = true;
} }
@@ -268,7 +207,6 @@ in
./clipboard.nix ./clipboard.nix
./cloud.nix ./cloud.nix
./direnv.nix ./direnv.nix
./dunst.nix
./fonts.nix ./fonts.nix
./fzf.nix ./fzf.nix
./git.nix ./git.nix
@@ -302,6 +240,7 @@ in
./vscode.nix ./vscode.nix
./wallpaper.nix ./wallpaper.nix
./zsh.nix ./zsh.nix
./applicative.nix
{ {
home-manager.users.me.home.file.".zshrc".text = '' home-manager.users.me.home.file.".zshrc".text = ''
# nothing to see here # nothing to see here

View File

@@ -1,65 +0,0 @@
{
lib,
pkgs,
...
}:
let
sgr = code: string: ''\u001b[${code}m${string}\u001b[0m'';
in
{
environment.systemPackages = [
(pkgs.writers.writeDashBin "notifications" ''
${pkgs.dunst}/bin/dunstctl history \
| ${pkgs.jq}/bin/jq -r '
.data[]
| map("${sgr "90" ''\(.appname.data)''} ${sgr "1" ''\(.summary.data)''} ${sgr "31" ''\(.body.data | gsub("\n"; " | "))''}")
| join("\n")'
'')
];
home-manager.users.me.services.dunst = {
enable = false;
settings = {
global = {
transparency = 10;
geometry = "200x5-30+20";
follow = "mouse";
indicate_hidden = true;
notification_height = 0;
separator_height = 2;
padding = 8;
horizontal_padding = 8;
sort = true;
markup = "full";
format = "%a\\n<b>%s</b>\\n%b";
alignment = "left";
show_age_threshold = 60;
bounce_freq = 0;
word_wrap = true;
ellipsize = "middle";
ignore_newline = false;
stack_duplicates = true;
hide_duplicate_count = false;
max_icon_size = 32;
sticky_history = true;
history_length = 20;
dmenu = "${pkgs.rofi}/bin/rofi -display-run dunst -show run";
browser = lib.getExe pkgs.niveum-browser;
verbosity = "mesg";
corner_radius = 0;
mouse_left_click = "do_action";
mouse_right_click = "close_current";
mouse_middle_click = "close_all";
};
urgency_low = {
timeout = 5;
};
urgency_normal = {
timeout = 10;
};
urgency_critical = {
timeout = 0;
};
};
};
}

View File

@@ -36,6 +36,7 @@
st = "status -s"; st = "status -s";
unstage = "reset HEAD --"; unstage = "reset HEAD --";
diffs = "diff --staged"; diffs = "diff --staged";
pushf = "push --force-with-lease";
last = "log -1 HEAD"; last = "log -1 HEAD";
logs = "log --pretty=oneline"; logs = "log --pretty=oneline";
graph = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"; graph = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";

View File

@@ -38,19 +38,6 @@ in
pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-hyprland
]; ];
# services.displayManager.cosmic-greeter = {
# enable = true;
# wayland.enable = true;
# extraPackages = with pkgs.kdePackages; [
# qtmultimedia
# qtsvg
# ];
# };
services.libinput = {
enable = true;
touchpad.tapping = true;
};
programs.regreet = programs.regreet =
let let
wallpaper = wallpaper =

View File

@@ -233,7 +233,10 @@ in
"${lib.getExe pkgs.hyprshot}, screencopy, allow" "${lib.getExe pkgs.hyprshot}, screencopy, allow"
"${pkgs.xdg-desktop-portal-hyprland}/libexec/.xdg-desktop-portal-hyprland-wrapped, screencopy, allow" "${pkgs.xdg-desktop-portal-hyprland}/libexec/.xdg-desktop-portal-hyprland-wrapped, screencopy, allow"
]; ];
monitor = ",preferred,auto,1"; # TODO https://wiki.hypr.land/Configuring/Monitors/ monitor = [
",preferred,auto,1" # TODO https://wiki.hypr.land/Configuring/Monitors/
"desc:Samsung Electric Company C27F390 HTQH602129, 1920x1080, 0x-1080, 1"
];
exec-once = [ exec-once = [
(lib.getExe pkgs.ashell) (lib.getExe pkgs.ashell)
"hyprctl dispatch exec \"[workspace special:ि silent] obsidian\"" "hyprctl dispatch exec \"[workspace special:ि silent] obsidian\""
@@ -242,6 +245,13 @@ in
# (lib.getExe pkgs.hyprpaper) # (lib.getExe pkgs.hyprpaper)
]; ];
device = [
{
name = "elan-touchscreen";
enabled = false;
}
];
general = { general = {
gaps_in = 2; gaps_in = 2;
gaps_out = 2; gaps_out = 2;
@@ -257,12 +267,12 @@ in
active_opacity = 1.0; active_opacity = 1.0;
inactive_opacity = 1.0; inactive_opacity = 1.0;
shadow = { shadow = {
enabled = true; enabled = false;
range = 4; range = 4;
render_power = 3; render_power = 3;
}; };
blur = { blur = {
enabled = true; enabled = false;
size = 3; size = 3;
passes = 1; passes = 1;
vibrancy = 0.17; vibrancy = 0.17;
@@ -369,10 +379,10 @@ in
extraConfig = '' extraConfig = ''
bind = ${mod}, R, submap, resize bind = ${mod}, R, submap, resize
submap = resize submap = resize
binde = , l, resizeactive, 10 0 binde = , l, resizeactive, 50 0
binde = , h, resizeactive, -10 0 binde = , h, resizeactive, -50 0
binde = , k, resizeactive, 0 -10 binde = , k, resizeactive, 0 -50
binde = , j, resizeactive, 0 10 binde = , j, resizeactive, 0 50
bind = , escape, submap, reset bind = , escape, submap, reset
submap = reset submap = reset
''; '';

View File

@@ -41,8 +41,8 @@ in
"Alt+j" = "add video-pan-y -0.05"; "Alt+j" = "add video-pan-y -0.05";
}; };
scripts = [ scripts = [
pkgs.mpvScripts.quality-menu # pkgs.mpvScripts.quality-menu
pkgs.mpvScripts.visualizer # pkgs.mpvScripts.visualizer
]; ];
}; };
}; };

View File

@@ -215,6 +215,7 @@ in
(python3.withPackages (py: [ (python3.withPackages (py: [
py.black py.black
py.ruff
# py.python-language-server # py.python-language-server
# py.pyls-mypy # py.pyls-mypy
# py.pyls-black # py.pyls-black

View File

@@ -66,7 +66,7 @@
}; };
sizes = { sizes = {
terminal = 10; terminal = 8;
applications = 10; applications = 10;
}; };
}; };

View File

@@ -235,7 +235,7 @@
stag = prev.callPackage packages/stag.nix { }; # TODO upstream stag = prev.callPackage packages/stag.nix { }; # TODO upstream
mpv = prev.mpv.override { mpv = prev.mpv.override {
scripts = [ scripts = [
final.mpvScripts.visualizer # final.mpvScripts.visualizer
final.mpvScripts.mpris final.mpvScripts.mpris
]; ];
}; };

View File

@@ -7,7 +7,7 @@
di-fm-key-file, di-fm-key-file,
radioStreams, radioStreams,
executableName ? "mpv-radio", executableName ? "mpv-radio",
mpvCommand ? "${mpv}/bin/mpv", mpvCommand ? "${mpv}/bin/mpv --force-window=yes",
}: }:
let let
streams = radioStreams.override { streams = radioStreams.override {

View File

@@ -5,6 +5,7 @@
}: }:
{ {
imports = [ imports = [
./cuda.nix
./hardware-configuration.nix ./hardware-configuration.nix
../../configs/networkmanager.nix ../../configs/networkmanager.nix
../../configs/default.nix ../../configs/default.nix

42
systems/fatteh/cuda.nix Normal file
View File

@@ -0,0 +1,42 @@
{
nixpkgs.config = {
allowUnfree = true;
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true; # needed for PRIME
open = false; # MX150 (Pascal) needs proprietary firmware
nvidiaSettings = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
# from lspci
intelBusId = "PCI:0:2:0"; # Intel UHD Graphics 620
nvidiaBusId = "PCI:1:0:0"; # NVIDIA GeForce MX150
};
};
nix.settings.system-features = [ "cuda" ];
programs.nix-required-mounts = {
enable = true;
presets.nvidia-gpu.enable = true;
# Workaround for <https://github.com/NixOS/nix/issues/9272>, copied from
# <https://github.com/nix-community/infra/pull/1807>.
extraWrapperArgs = [
"--run shift"
"--add-flag '${
builtins.unsafeDiscardOutputDependency
(derivation {
name = "needs-cuda";
builder = "_";
system = "_";
requiredSystemFeatures = [ "cuda" ];
}).drvPath
}'"
];
};
}