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

6 Commits

7 changed files with 72 additions and 43 deletions

View File

@@ -6,16 +6,18 @@
unstablePackages,
inputs,
...
}: let
}:
let
inherit (lib.strings) makeBinPath;
inherit (import ../lib) localAddresses kieran remoteDir;
defaultApplications = (import ../lib).defaultApplications {inherit pkgs;};
in {
defaultApplications = (import ../lib).defaultApplications { inherit pkgs; };
in
{
imports = [
inputs.self.nixosModules.system-dependent
inputs.self.nixosModules.power-action
{
boot.supportedFilesystems = ["ntfs"];
boot.supportedFilesystems = [ "ntfs" ];
}
{
nixpkgs = {
@@ -74,7 +76,10 @@ in {
hashedPasswordFile = config.age.secrets.kfm-password.path;
isNormalUser = true;
uid = 1000;
extraGroups = ["pipewire" "audio"];
extraGroups = [
"pipewire"
"audio"
];
};
nix.settings.trusted-users = [ config.users.users.me.name ];
@@ -87,25 +92,27 @@ in {
}
{
environment.interactiveShellInit = "export PATH=$PATH";
environment.shellAliases = let
swallow = command: "${niveumPackages.swallow}/bin/swallow ${command}";
in {
o = "${pkgs.xdg-utils}/bin/xdg-open";
ns = "nix-shell --run zsh";
pbcopy = "${pkgs.xclip}/bin/xclip -selection clipboard -in";
pbpaste = "${pkgs.xclip}/bin/xclip -selection clipboard -out";
tmux = "${pkgs.tmux}/bin/tmux -2";
sxiv = swallow "${pkgs.nsxiv}/bin/nsxiv";
zathura = swallow "${pkgs.zathura}/bin/zathura";
im = "${pkgs.openssh}/bin/ssh weechat@makanek -t tmux attach-session -t IM";
yt = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -ic"; # Download video link
yta = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata --audio-format opus --audio-quality 0 -xic"; # Download with audio
};
environment.shellAliases =
let
swallow = command: "${niveumPackages.swallow}/bin/swallow ${command}";
in
{
o = "${pkgs.xdg-utils}/bin/xdg-open";
ns = "nix-shell --run zsh";
pbcopy = "${pkgs.xclip}/bin/xclip -selection clipboard -in";
pbpaste = "${pkgs.xclip}/bin/xclip -selection clipboard -out";
tmux = "${pkgs.tmux}/bin/tmux -2";
sxiv = swallow "${pkgs.nsxiv}/bin/nsxiv";
zathura = swallow "${pkgs.zathura}/bin/zathura";
im = "${pkgs.openssh}/bin/ssh weechat@makanek -t tmux attach-session -t IM";
yt = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -ic"; # Download video link
yta = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata --audio-format opus --audio-quality 0 -xic"; # Download with audio
};
}
{
i18n = {
defaultLocale = "en_DK.UTF-8";
supportedLocales = ["all"];
supportedLocales = [ "all" ];
};
}
{
@@ -121,12 +128,18 @@ in {
enable = true;
greeters.gtk = {
enable = true;
indicators = ["~spacer" "~host" "~spacer" "~session" "~power"];
indicators = [
"~spacer"
"~host"
"~spacer"
"~session"
"~power"
];
};
};
};
}
{programs.command-not-found.enable = true;}
{ programs.command-not-found.enable = true; }
{
programs.gnupg = {
agent = {
@@ -141,7 +154,11 @@ in {
environment.systemPackages = [
pkgs.gnupg
(pkgs.pass.withExtensions (e: [e.pass-otp e.pass-import e.pass-genphrase]))
(pkgs.pass.withExtensions (e: [
e.pass-otp
e.pass-import
e.pass-genphrase
]))
];
}
{
@@ -154,12 +171,10 @@ in {
};
}
{
networking.hosts =
lib.mapAttrs' (name: address: {
name = address;
value = ["${name}.local"];
})
localAddresses;
networking.hosts = lib.mapAttrs' (name: address: {
name = address;
value = [ "${name}.local" ];
}) localAddresses;
}
{
home-manager.users.me.home.stateVersion = "22.05";
@@ -167,9 +182,9 @@ in {
}
{
systemd.user.services.udiskie = {
after = ["udisks2.service"];
wants = ["udisks2.service"];
wantedBy = ["graphical-session.target"];
after = [ "udisks2.service" ];
wants = [ "udisks2.service" ];
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.udiskie}/bin/udiskie --verbose --no-config --notify";
};
@@ -212,7 +227,8 @@ in {
./keyboard.nix
./mycelium.nix
./kdeconnect.nix
{home-manager.users.me.home.file.".XCompose".source = ../lib/keyboards/XCompose;}
{ home-manager.users.me.home.file.".XCompose".source = ../lib/keyboards/XCompose; }
{ services.upower.enable = true; }
./lb.nix
./mpv.nix
./mime.nix
@@ -276,7 +292,7 @@ in {
download = "${config.users.users.me.home}/sync/Downloads";
music = "${config.users.users.me.home}/mobile/audio";
pictures = "${config.users.users.me.home}/cloud/nextcloud/Bilder";
publicShare = "${config.users.users.me.home}/cloud/nextcloud/tmp";
publicShare = "${config.users.users.me.home}/cloud/nextcloud/tmp";
videos = pictures;
};
};

View File

@@ -131,7 +131,10 @@ in {
(pkgs.writers.writeDashBin "fu-vpn" ''
if ${pkgs.wirelesstools}/bin/iwgetid | ${pkgs.gnugrep}/bin/grep --invert-match eduroam
then
${pkgs.openconnect}/bin/openconnect vpn.fu-berlin.de --useragent=AnyConnect
# root firefox will not open login window unless root owns Xauthority
sudo cp $XAUTHORITY /root/.Xauthority
sudo chown root: /root/.Xauthority
XAUTHORITY=/root/.Xauthority sudo ${pkgs.openconnect}/bin/openconnect vpn.fu-berlin.de --useragent=AnyConnect
fi
'')
];

View File

@@ -6,10 +6,8 @@
...
}: let
dashboard = pkgs.writers.writeDashBin "dashboard" ''
${pkgs.alacritty}/bin/alacritty --class wtf --command ${pkgs.writers.writeDash "dashboard-inner" ''
export WTF_OWM_API_KEY="$(cat ${config.age.secrets.openweathermap-api-key.path})"
export WTF_MINIFLUX_API_KEY="$(cat ${config.age.secrets.miniflux-api-token.path})"
exec ${niveumPackages.dashboard}/bin/dashboard
${pkgs.alacritty}/bin/alacritty --option font.size=4 --class dashboard --command ${pkgs.writers.writeDash "dashboard-inner" ''
exec ${pkgs.procps}/bin/watch -c -n 10 ${niveumPackages.q}/bin/q
''}
'';
inherit (import ../lib) defaultApplications;
@@ -310,7 +308,7 @@ in {
exec "${pkgs.writers.writeDash "irc" "exec ${pkgs.alacritty}/bin/alacritty --class message -e ssh weechat@makanek -t tmux attach-session -t IM"}"
exec "${pkgs.writers.writeDash "email" "exec ${pkgs.alacritty}/bin/alacritty --class message -e aerc"}"
assign [class="wtf"] ${infoWorkspace}
assign [class="dashboard"] ${infoWorkspace}
exec ${dashboard}/bin/dashboard
'';
config = lib.mkMerge [

View File

@@ -55,7 +55,9 @@
}
{
block = "battery";
device = config.niveum.batteryName;
format = "$icon $percentage $time";
device = "DisplayDevice";
driver = "upower";
}
{
block = "sound";

View File

@@ -75,8 +75,8 @@ in {
user = "kfm";
port = sshPort;
};
kibbeh = {
hostname = "kibbeh.r";
kabsa = {
hostname = "kabsa.r";
user = "kfm";
port = sshPort;
};

View File

@@ -395,6 +395,7 @@
opustags = pkgs.callPackage packages/opustags.nix {};
pls = pkgs.callPackage packages/pls.nix {};
polyglot = pkgs.callPackage packages/polyglot.nix {};
q = pkgs.callPackage packages/q.nix {};
qrpaste = pkgs.callPackage packages/qrpaste.nix {};
random-zeno = pkgs.callPackage packages/random-zeno.nix {};
rfc = pkgs.callPackage packages/rfc.nix {};

9
packages/q.nix Normal file
View File

@@ -0,0 +1,9 @@
{ writers, lib, todoman, khal, util-linux, wego, pass }:
writers.writeDashBin "q" ''
export PATH=$PATH:${lib.makeBinPath [todoman khal util-linux wego pass]}
(todo list --due 240; echo) &
(khal list today today; echo) &
(cal -3; echo) &
(wego -location Berlin -owm-api-key "$(pass api-keys/openweathermap)" -frontend emoji -days 2; echo) &
wait
''