(desktop) Gen 494: reformatted several files using alejandra

This commit is contained in:
pagedMov
2024-10-15 20:16:32 -04:00
parent 1441353258
commit bd1add14bb
98 changed files with 6440 additions and 3256 deletions

4
flake.lock generated
View File

@@ -870,7 +870,7 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-wk+pdZUCu13qvhHBrycwrvGnRUaf6dbLchr3yF96C1c=",
"narHash": "sha256-+aYqfRtAoaA4wqPfy4j2biNTVj2TtEmmHXDKOzNoU6g=",
"path": "./pkgs/nixvim",
"type": "path"
},
@@ -1016,7 +1016,7 @@
},
"locked": {
"lastModified": 1,
"narHash": "sha256-S3crmqg/CDKf+QTwnZUR6udyjsvqS0P0y56wGuJmOno=",
"narHash": "sha256-G8k9Ue2ZggJXD17cDXQubY+b4utp2YLnSpQWe06mR4E=",
"path": "./pkgs/toilet",
"type": "path"
},

View File

@@ -43,12 +43,18 @@
toilet.url = "path:./pkgs/toilet";
};
outputs = { nixpkgs, nur, home-manager, self, nvim, toilet, ... }@inputs:
let
outputs = {
nixpkgs,
nur,
home-manager,
self,
nvim,
toilet,
...
} @ inputs: let
system = "x86_64-linux";
username = "pagedmov";
in
{
in {
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
specialArgs = {

View File

@@ -1,7 +1,12 @@
{ host, inputs, username, nur, pkgs, self, ... }:
{
host,
inputs,
username,
nur,
pkgs,
self,
...
}: {
imports = [
./../../modules/sys
./hardware.nix
@@ -9,4 +14,3 @@
./steam.nix
];
}

View File

@@ -1,46 +1,50 @@
# 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, modulesPath, username, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
config,
lib,
modulesPath,
username,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "uas" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "uas" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a687e4e2-8665-43f1-9d62-3e3f21423579";
fileSystems."/" = {
device = "/dev/disk/by-uuid/a687e4e2-8665-43f1-9d62-3e3f21423579";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/6EAD-2C48";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6EAD-2C48";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
options = ["fmask=0022" "dmask=0022"];
};
fileSystems."/home" =
{ device = "/dev/nvme0n1p5";
fileSystems."/home" = {
device = "/dev/nvme0n1p5";
fsType = "ext4";
};
fileSystems."/home/${username}/steamlib" =
{ device = "/dev/nvme0n1p1";
fileSystems."/home/${username}/steamlib" = {
device = "/dev/nvme0n1p1";
fsType = "ext4";
};
swapDevices = [ ];
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`.
# 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.enp14s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp14s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware = {

View File

@@ -1,13 +1,11 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
system.stateVersion = "24.05";
nixpkgs.config.allowUnfree = true;
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://nix-gaming.cachix.org" ];
experimental-features = ["nix-command" "flakes"];
substituters = ["https://nix-gaming.cachix.org"];
};
gc = {
automatic = true;

View File

@@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs.steam = {
enable = true;
remotePlay.openFirewall = true;

View File

@@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{
config,
pkgs,
...
}: {
boot = {
kernelModules = ["acpi_call"];
extraModulePackages = with config.boot.kernelPackages;

View File

@@ -1,6 +1,12 @@
{ host, inputs, pkgs, config, self, username, ... }:
{
host,
inputs,
pkgs,
config,
self,
username,
...
}: {
imports = [
./../../modules/sys
./hardware.nix

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
environment = {
variables = {
XCURSOR_SIZE = "24";

View File

@@ -1,30 +1,34 @@
# 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" "ehci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "sd_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/334f742b-460f-43f8-b819-33086adfa9fb";
fileSystems."/" = {
device = "/dev/disk/by-uuid/334f742b-460f-43f8-b819-33086adfa9fb";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/ECD9-F43B";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/ECD9-F43B";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [ ];
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

View File

@@ -1,12 +1,9 @@
{ ... }:
{
{...}: {
services = {
keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
ids = ["*"];
settings.main = {
capslock = "esc";
};
@@ -36,8 +33,8 @@
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "performance";
INTEL_GPU_MIN_FREQ_ON_AC=500;
INTEL_GPU_MIN_FREQ_ON_BAT=500;
INTEL_GPU_MIN_FREQ_ON_AC = 500;
INTEL_GPU_MIN_FREQ_ON_BAT = 500;
# INTEL_GPU_MAX_FREQ_ON_AC=0;
# INTEL_GPU_MAX_FREQ_ON_BAT=0;
# INTEL_GPU_BOOST_FREQ_ON_AC=0;

View File

@@ -1,13 +1,11 @@
{ ... }:
{
{...}: {
system.stateVersion = "24.05";
nixpkgs.config.allowUnfree = true;
nix = {
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://nix-gaming.cachix.org" ];
experimental-features = ["nix-command" "flakes"];
substituters = ["https://nix-gaming.cachix.org"];
};
gc = {
automatic = true;
@@ -16,10 +14,8 @@
};
};
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8";
powerManagement.cpuFreqGovernor = "performance";
}

View File

@@ -1,29 +1,33 @@
{ host, nur, self, inputs, username, config, home-manager, ... }:
{
host,
nur,
self,
inputs,
username,
config,
home-manager,
...
}: {
imports =
[ (import ./programs/btop.nix) ]
++ [ (import ./programs/yazi.nix) ]
++ [ (import ./programs/kitty.nix) ]
++ [ (import ./programs/fuzzel.nix) ]
++ [ (import ./programs/eza.nix) ]
++ [ (import ./programs/cava.nix) ]
++ [ (import ./programs/bat.nix) ]
++ [ (import ./programs/fzf.nix) ]
++ [ (import ./programs/git.nix) ]
++ [ (import ./programs/password-store.nix) ]
++ [ (import ./programs/autojump.nix) ]
++ [ (import ./environment/gtk.nix) ]
++ [ (import ./environment/spicetify.nix) ]
++ [ (import ./environment/starship.nix) ]
++ [ (import ./environment/desktop_userpkgs.nix) ]
++ [ (import ./environment/zshell.nix) ]
++ [ (import ./firefox/firefox.nix) ]
++ [ (import ./hyprland) ]
++ [ (import ./scripts ) ]
++ [ (import ./swaync/swaync.nix) ]
++ [ (import ./waybar) ];
[(import ./programs/btop.nix)]
++ [(import ./programs/yazi.nix)]
++ [(import ./programs/kitty.nix)]
++ [(import ./programs/fuzzel.nix)]
++ [(import ./programs/eza.nix)]
++ [(import ./programs/cava.nix)]
++ [(import ./programs/bat.nix)]
++ [(import ./programs/fzf.nix)]
++ [(import ./programs/git.nix)]
++ [(import ./programs/password-store.nix)]
++ [(import ./programs/autojump.nix)]
++ [(import ./environment/gtk.nix)]
++ [(import ./environment/spicetify.nix)]
++ [(import ./environment/starship.nix)]
++ [(import ./environment/desktop_userpkgs.nix)]
++ [(import ./environment/zshell.nix)]
++ [(import ./firefox/firefox.nix)]
++ [(import ./hyprland)]
++ [(import ./scripts)]
++ [(import ./swaync/swaync.nix)]
++ [(import ./waybar)];
}

View File

@@ -1,9 +1,11 @@
{ pkgs, inputs, ... }:
let
{
pkgs,
inputs,
...
}: let
nvim = inputs.nvim.packages."x86_64-linux".default;
toilet = inputs.toilet.packages."x86_64-linux".default;
in
{
in {
home.packages = with pkgs; [
gtk3
uhk-agent

View File

@@ -1,10 +1,12 @@
{ pkgs, config, ... }:
{
pkgs,
config,
...
}: {
fonts.fontconfig.enable = true;
home.packages = [
pkgs.nerdfonts
(pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" "Noto" ]; })
(pkgs.nerdfonts.override {fonts = ["JetBrainsMono" "Noto"];})
pkgs.twemoji-color-font
pkgs.noto-fonts-emoji
];

View File

@@ -1,9 +1,11 @@
{ pkgs, inputs, ... }:
let
{
pkgs,
inputs,
...
}: let
nvim = inputs.nvim.packages."x86_64-linux".default;
toilet = inputs.toilet.packages."x86_64-linux".default;
in
{
in {
home.packages = with pkgs; [
gtk3
uhk-agent

View File

@@ -1,9 +1,11 @@
{ pkgs, lib, inputs, ...}:
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in
{
pkgs,
lib,
inputs,
...
}: let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in {
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"spotify"

View File

@@ -1,10 +1,13 @@
{ lib, inputs, ... }:
{
lib,
inputs,
...
}: {
programs.starship = {
enable = true;
enableZshIntegration = false;
settings = {
settings =
{
add_newline = true;
right_format = "($custom)";
@@ -15,7 +18,6 @@
"$line_break[ > ](bold #89b4fa)"
];
username = {
show_always = true;
style_user = "bold white";
@@ -29,7 +31,7 @@
character = {
success_symbol = "[ -> ](bold green)";
error_symbol = "[ -> ](bold red)";
# error_symbol = "[ ](bold #89dceb)[ ✗](bold red)";
# error_symbol = "[ ](bold #89dceb)[ ✗](bold red)";
};
cmd_duration = {
@@ -55,7 +57,7 @@
};
palette = "catppuccin_mocha";
} // builtins.fromTOML (builtins.readFile "${inputs.catppuccin-starship}/themes/mocha.toml");
}
// builtins.fromTOML (builtins.readFile "${inputs.catppuccin-starship}/themes/mocha.toml");
};
}

View File

@@ -1,6 +1,4 @@
{ self, ... }:
{
{self, ...}: {
programs.zoxide = {
enable = true;
enableZshIntegration = true;
@@ -22,7 +20,7 @@
oh-my-zsh = {
enable = true;
plugins = [ "git" "fzf" ];
plugins = ["git" "fzf"];
};
enableCompletion = true;
@@ -50,7 +48,7 @@
sr = "source ~/.zshrc";
".." = "cd ..";
rm = "echo 'use \"gtp\" instead'";
psg = "ps aux | grep -v grep | grep -i -e VSZ -e" ;
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";
mkdir = "mkdir -p";
pk = "pkill -9 -f";
zrc = "nvim $HOME/dots/zshell.nix";
@@ -133,6 +131,4 @@
scheck && runbg aplay ${self}/media/sound/sh-source.wav
'';
};
}

View File

@@ -1,13 +1,16 @@
{ nur, username, self, ... }:
{
nur,
username,
self,
...
}: {
programs.firefox = {
enable = true;
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value= true;
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
@@ -26,25 +29,32 @@
profiles.${username} = {
name = "${username}";
bookmarks = [
{ name = "NixOS Options";
{
name = "NixOS Options";
url = "https://search.nixos.org/options";
}
{ name = "Home Manager Options";
{
name = "Home Manager Options";
url = "https://home-manager-options.extranix.com/";
}
{ name = "Nixvim Docs";
{
name = "Nixvim Docs";
url = "https://nix-community.github.io/nixvim/";
}
{ name = "Rust Manual";
{
name = "Rust Manual";
url = "https://doc.rust-lang.org/book/ch01-03-hello-cargo.html";
}
{ name = "ChatGPT";
{
name = "ChatGPT";
url = "https://chatgpt.com/";
}
{ name = "DataAnnotation";
{
name = "DataAnnotation";
url = "https://app.dataannotation.tech/users/sign_in";
}
{ name = "Nerd Fonts Cheatsheet";
{
name = "Nerd Fonts Cheatsheet";
url = "https://www.nerdfonts.com/cheat-sheet";
}
];

View File

@@ -1,11 +1,15 @@
{ inputs, host, ... }:
let
host_config = if (host == "desktop") then [ ./desktop.nix ] else [ ./laptop.nix ];
in
{
inputs,
host,
...
}: let
host_config =
if (host == "desktop")
then [./desktop.nix]
else [./laptop.nix];
in {
imports =
[ (import ./hyprland.nix) ]
++ [ (import ./hyprpaper.nix) ]
[(import ./hyprland.nix)]
++ [(import ./hyprpaper.nix)]
++ host_config;
}

View File

@@ -1,9 +1,6 @@
{ username, ... }:
{
{username, ...}: {
wayland.windowManager.hyprland = {
settings = {
monitor = [
"DP-1, 1920x1080@144, 1920x0, 1"
"HDMI-A-1, 1920x1080, 0x0, 1"

View File

@@ -1,6 +1,8 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
...
}: {
home.packages = with pkgs; [
swaybg
inputs.hypr-contrib.packages.${pkgs.system}.grimblast
@@ -13,7 +15,7 @@
wayland
direnv
];
systemd.user.targets.hyprland-session.Unit.Wants = [ "xdg-desktop-autostart.target" ];
systemd.user.targets.hyprland-session.Unit.Wants = ["xdg-desktop-autostart.target"];
wayland.windowManager.hyprland = {
enable = true;
xwayland = {

View File

@@ -1,18 +1,23 @@
{ host, username, ... }:
{
host,
username,
...
}: {
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
splash = false;
splash_offset = 2.0;
preload = [ "/home/${username}/Pictures/Wallpapers/cat-leaves.png" ];
preload = ["/home/${username}/Pictures/Wallpapers/cat-leaves.png"];
wallpaper = if (host == "desktop") then [
wallpaper =
if (host == "desktop")
then [
"DP-1,/home/${username}/Pictures/Wallpapers/cat-leaves.png"
"HDMI-A-1,/home/${username}/Pictures/Wallpapers/cat-leaves.png"
] else [
]
else [
"eDP-1,/home/${username}/Pictures/Wallpapers/cat-leaves.png"
];
};

View File

@@ -1,9 +1,6 @@
{ username, ... }:
{
{username, ...}: {
wayland.windowManager.hyprland = {
settings = {
monitor = [
"eDP-1, 1920x1080@144, 1920x0, 1"
];

View File

@@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs.autojump = {
enable = true;
enableZshIntegration = true;

View File

@@ -1,6 +1,4 @@
{ inputs, ... }:
{
{inputs, ...}: {
programs.bat = {
enable = true;
config = {

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.btop = {
enable = true;
@@ -17,5 +15,5 @@
};
};
home.packages = (with pkgs; [ nvtopPackages.intel ]);
home.packages = with pkgs; [nvtopPackages.intel];
}

View File

@@ -1,12 +1,16 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
...
}: {
programs.cava = {
enable = true;
};
# https://github.com/catppuccin/cava
home.file.".config/cava/config".text = ''
home.file.".config/cava/config".text =
''
# custom cava config
'' + builtins.readFile "${inputs.catppuccin-cava}/themes/mocha.cava";
''
+ builtins.readFile "${inputs.catppuccin-cava}/themes/mocha.cava";
}

View File

@@ -1,10 +1,8 @@
{ ... }:
{
{...}: {
programs.eza = {
enable = true;
enableZshIntegration = false;
extraOptions = [ "-1" "-h" "--group-directories-first" ];
extraOptions = ["-1" "-h" "--group-directories-first"];
icons = "auto";
git = true;
};

View File

@@ -1,13 +1,14 @@
{ nur, username }:
{
nur,
username,
}: {
programs.firefox = {
enable = true;
policies = {
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value= true;
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
@@ -26,42 +27,54 @@
profiles.${username} = {
name = "${username}";
bookmarks = [
{ name = "Nix sites";
{
name = "Nix sites";
toolbar = true;
bookmarks = [
{ name = "NixOS Options";
{
name = "NixOS Options";
url = "https://search.nixos.org/options";
}
{ name = "Home Manager Options";
{
name = "Home Manager Options";
url = "https://home-manager-options.extranix.com/";
}
{ name = "Nixvim Docs";
{
name = "Nixvim Docs";
url = "https://nix-community.github.io/nixvim/";
}
{ name = "Noogle";
{
name = "Noogle";
url = "https://noogle.dev/";
}
{ name = "NixOS Wiki";
{
name = "NixOS Wiki";
url = "https://nixos.wiki/";
}
{ name = "NixOS Manual";
{
name = "NixOS Manual";
url = "https://nixos.org/manual/nixos/stable";
}
{ name = "Nixpkgs Reference";
{
name = "Nixpkgs Reference";
url = "https://nixos.org/manual/nixpkgs/stable";
}
];
}
{ name = "Rust Manual";
{
name = "Rust Manual";
url = "https://doc.rust-lang.org/book/ch01-03-hello-cargo.html";
}
{ name = "ChatGPT";
{
name = "ChatGPT";
url = "https://chatgpt.com/";
}
{ name = "DataAnnotation";
{
name = "DataAnnotation";
url = "https://app.dataannotation.tech/users/sign_in";
}
{ name = "Nerd Fonts Cheatsheet";
{
name = "Nerd Fonts Cheatsheet";
url = "https://www.nerdfonts.com/cheat-sheet";
}
];

View File

@@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs.fuzzel = {
enable = true;
settings = {
@@ -9,7 +7,7 @@
line-height = 25;
fields = "name,generic,comment,categories,filename,keywords";
terminal = "kitty";
prompt = "' '" ;
prompt = "' '";
icon-theme = "Papirus-Dark";
layer = "top";
lines = 10;

View File

@@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs.fzf = {
enable = true;
enableZshIntegration = true;

View File

@@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs.git = {
enable = true;
userEmail = "pagedmov@gmail.com";

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.kitty = {
enable = true;

View File

@@ -1,9 +1,6 @@
{ username, ... }:
let
{username, ...}: let
home = "/home/${username}";
in
{
in {
programs.password-store = {
enable = true;
settings = {

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,16 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "compress" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "compress" (''
#!/usr/bin/env bash
if (( $# == 1 )) then
if (( $# == 1 )) then
# echo -ne "Archive name: "
# read name
# tar -cvzf "$name.tar.gz" $1
tar -cvzf "$1.tar.gz" $1
else
else
echo "Wrong number of arguments..."
fi
'')
fi
''

View File

@@ -1,9 +1,10 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "crs" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "crs" (''
#!/run/current-system/sw/bin/bash
cargo test && \
cargo run
'')
cargo test && \
cargo run
''

View File

@@ -1,11 +1,12 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "extract" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "extract" (''
#!/usr/bin/env bash
for i in "$@" ; do
for i in "$@" ; do
tar -xvzf $i
break
done
'')
done
''

View File

@@ -1,8 +1,9 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "invoke" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "invoke" (''
#!/run/current-system/sw/bin/bash
nix run nixpkgs#$"@"
'')
nix run nixpkgs#$"@"
''

View File

@@ -1,11 +1,12 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "keybinds" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "keybinds" (''
#!/usr/bin/env bash
config_file=~/.config/hypr/hyprland.conf
keybinds=$(grep -oP '(?<=bind=).*' $config_file)
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
rofi -dmenu -theme-str 'window {width: 50%;}' <<< "$keybinds"
'')
config_file=~/.config/hypr/hyprland.conf
keybinds=$(grep -oP '(?<=bind=).*' $config_file)
keybinds=$(echo "$keybinds" | sed 's/,\([^,]*\)$/ = \1/' | sed 's/, exec//g' | sed 's/^,//g')
rofi -dmenu -theme-str 'window {width: 50%;}' <<< "$keybinds"
''

View File

@@ -1,10 +1,11 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "mcd" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "mcd" (''
#!/run/current-system/sw/bin/bash
mkdir -p "$1"
cd "$1" || exit
'')
mkdir -p "$1"
cd "$1" || exit
''

View File

@@ -1,21 +1,22 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "runbg" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "runbg" (''
#!/usr/bin/env bash
[ $# -eq 0 ] && { # $# is number of args
[ $# -eq 0 ] && { # $# is number of args
echo "$(basename $0): missing command" >&2
exit 1
}
prog="$(which "$1")" # see below
[ -z "$prog" ] && {
}
prog="$(which "$1")" # see below
[ -z "$prog" ] && {
echo "$(basename $0): unknown command: $1" >&2
exit 1
}
shift # remove $1, now $prog, from args
tty -s && exec </dev/null # if stdin is a terminal, redirect from null
tty -s <&1 && exec >/dev/null # if stdout is a terminal, redirect to null
tty -s <&2 && exec 2>&1 # stderr to stdout (which might not be null)
"$prog" "$@" & # $@ is all args
'')
}
shift # remove $1, now $prog, from args
tty -s && exec </dev/null # if stdin is a terminal, redirect from null
tty -s <&1 && exec >/dev/null # if stdout is a terminal, redirect to null
tty -s <&2 && exec 2>&1 # stderr to stdout (which might not be null)
"$prog" "$@" & # $@ is all args
''

View File

@@ -1,8 +1,9 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "scheck" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "scheck" (''
#!/run/current-system/sw/bin/bash
[ "$SOUNDS_ENABLED" -eq 1 ]
'')
[ "$SOUNDS_ENABLED" -eq 1 ]
''

View File

@@ -1,12 +1,12 @@
{ self, pkgs }:
pkgs.writeShellScriptBin "splash" (''
#!/bin/bash
echo "NixOS kernel ver. $(uname -a | awk '{print $3}') x86_64 GNU/Linux"
date +"%A %B %-d %Y"
echo -e "\033[38;2;0;180;205m$(toilet -t -f Slant.flf glasshouse)\033[0m"
echo
'')
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "splash" ''
#!/bin/bash
echo "NixOS kernel ver. $(uname -a | awk '{print $3}') x86_64 GNU/Linux"
date +"%A %B %-d %Y"
echo -e "\033[38;2;0;180;205m$(toilet -t -f Slant.flf glasshouse)\033[0m"
echo
''

View File

@@ -1,35 +1,117 @@
{ host, self, pkgs, ... }:
let
compress = (import ./commands/compress.nix { self = self; pkgs = pkgs;});
passhelper = (import ./wm-controls/passhelper.nix { self = self; pkgs = pkgs;});
crs = (import ./commands/crs.nix { self = self; pkgs = pkgs;});
extract = (import ./commands/extract.nix { self = self; pkgs = pkgs;});
invoke = (import ./commands/invoke.nix { self = self; pkgs = pkgs;});
splash = (import ./commands/splash.nix { self = self; pkgs = pkgs;});
scheck = (import ./commands/s_check.nix { self = self; pkgs = pkgs;});
runbg = (import ./commands/runbg.nix { self = self; pkgs = pkgs;});
mcd = (import ./commands/mcd.nix { self = self; pkgs = pkgs;});
garbage-collect = (import ./nix/garbage-collect.nix { self = self; pkgs = pkgs;});
homep = (import ./nix/homep.nix { self = self; pkgs = pkgs;});
homer = (import ./nix/homer.nix { self = self; pkgs = pkgs;});
nsp = (import ./nix/nsp.nix { self = self; pkgs = pkgs;});
nixr = (import ./nix/nixr.nix { self = self; pkgs = pkgs;});
nixp = (import ./nix/nixp.nix { self = self; pkgs = pkgs;});
hyprland = (import ./wm-controls/hyprland.nix { pkgs=pkgs; });
lofi = (import ./wm-controls/lofi.nix { self = self; pkgs = pkgs;});
music = (import ./wm-controls/music.nix { self = self; pkgs = pkgs;});
shutdown-script = (import ./wm-controls/shutdown-script.nix { self = self; pkgs = pkgs;});
switchmon = (import ./wm-controls/switchmon.nix { self = self; pkgs = pkgs;});
toggle_blur = (import ./wm-controls/toggle_blur.nix { self = self; pkgs = pkgs;});
toggle_float = (import ./wm-controls/toggle_float.nix { self = self; pkgs = pkgs;});
toggle_oppacity = (import ./wm-controls/toggle_oppacity.nix { self = self; pkgs = pkgs;});
toggle_waybar = (import ./wm-controls/toggle_waybar.nix { self = self; pkgs = pkgs;});
rebuild = (import ./nix/rebuild.nix { host = host; self = self; pkgs = pkgs;});
nixcommit = (import ./nix/nixcommit.nix { host = host; self = self; pkgs = pkgs;});
nixpush = (import ./nix/nixpush.nix { self = self; pkgs = pkgs;});
in
{
host,
self,
pkgs,
...
}: let
compress = import ./commands/compress.nix {
self = self;
pkgs = pkgs;
};
passhelper = import ./wm-controls/passhelper.nix {
self = self;
pkgs = pkgs;
};
crs = import ./commands/crs.nix {
self = self;
pkgs = pkgs;
};
extract = import ./commands/extract.nix {
self = self;
pkgs = pkgs;
};
invoke = import ./commands/invoke.nix {
self = self;
pkgs = pkgs;
};
splash = import ./commands/splash.nix {
self = self;
pkgs = pkgs;
};
scheck = import ./commands/s_check.nix {
self = self;
pkgs = pkgs;
};
runbg = import ./commands/runbg.nix {
self = self;
pkgs = pkgs;
};
mcd = import ./commands/mcd.nix {
self = self;
pkgs = pkgs;
};
garbage-collect = import ./nix/garbage-collect.nix {
self = self;
pkgs = pkgs;
};
homep = import ./nix/homep.nix {
self = self;
pkgs = pkgs;
};
homer = import ./nix/homer.nix {
self = self;
pkgs = pkgs;
};
nsp = import ./nix/nsp.nix {
self = self;
pkgs = pkgs;
};
nixr = import ./nix/nixr.nix {
self = self;
pkgs = pkgs;
};
nixp = import ./nix/nixp.nix {
self = self;
pkgs = pkgs;
};
hyprland = import ./wm-controls/hyprland.nix {pkgs = pkgs;};
lofi = import ./wm-controls/lofi.nix {
self = self;
pkgs = pkgs;
};
music = import ./wm-controls/music.nix {
self = self;
pkgs = pkgs;
};
shutdown-script = import ./wm-controls/shutdown-script.nix {
self = self;
pkgs = pkgs;
};
switchmon = import ./wm-controls/switchmon.nix {
self = self;
pkgs = pkgs;
};
toggle_blur = import ./wm-controls/toggle_blur.nix {
self = self;
pkgs = pkgs;
};
toggle_float = import ./wm-controls/toggle_float.nix {
self = self;
pkgs = pkgs;
};
toggle_oppacity = import ./wm-controls/toggle_oppacity.nix {
self = self;
pkgs = pkgs;
};
toggle_waybar = import ./wm-controls/toggle_waybar.nix {
self = self;
pkgs = pkgs;
};
rebuild = import ./nix/rebuild.nix {
host = host;
self = self;
pkgs = pkgs;
};
nixcommit = import ./nix/nixcommit.nix {
host = host;
self = self;
pkgs = pkgs;
};
nixpush = import ./nix/nixpush.nix {
self = self;
pkgs = pkgs;
};
in {
home.packages = [
compress
passhelper

View File

@@ -1,31 +1,32 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "garbage-collect" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "garbage-collect" (''
#!/run/current-system/sw/bin/bash
echo "This will delete all unused paths in the nix store and delete any files in the gtrash folder."
echo -e "\033[1;4;38;2;243;139;168mThis process is irreversible.\033[0m Are you sure?"
select yn in "Yes" "No"; do
echo "This will delete all unused paths in the nix store and delete any files in the gtrash folder."
echo -e "\033[1;4;38;2;243;139;168mThis process is irreversible.\033[0m Are you sure?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "Sweeping system...";scheck && runbg aplay "$HOME/media/sound/sys/collectgarbage.wav";break;;
No ) echo "Canceling garbage collection."; return;;
esac
done
output=$(nix-collect-garbage | tee /dev/tty)
done
output=$(nix-collect-garbage | tee /dev/tty)
nix_freed=$(echo "$output" | grep -oP '\d+(\.\d+)? MiB freed' | cut -d' ' -f1)
nix_freed=$(echo "$output" | grep -oP '\d+(\.\d+)? MiB freed' | cut -d' ' -f1)
if [ "$(ls -A ~/.local/share/Trash/files/ 2>/dev/null)" ]; then
if [ "$(ls -A ~/.local/share/Trash/files/ 2>/dev/null)" ]; then
rm_freed=$(du ~/.local/share/Trash/files 2> /dev/null | awk '{print $1}')
rm_freed=$(echo "scale=2; $rm_freed / 1000" | bc)
/run/current-system/sw/bin/rm -rfv ~/.local/share/Trash/files
mkdir ~/.local/share/Trash/files
else
else
rm_freed="0"
fi
total_freed=$(echo "$nix_freed + $rm_freed" | bc)
echo -e "System cleaning complete, freed \033[1;4;38;2;166;227;161m$total_freed MiB\033[0m in total"
scheck && runbg aplay "$HOME/media/sound/sys/rm.wav"
'')
fi
total_freed=$(echo "$nix_freed + $rm_freed" | bc)
echo -e "System cleaning complete, freed \033[1;4;38;2;166;227;161m$total_freed MiB\033[0m in total"
scheck && runbg aplay "$HOME/media/sound/sys/rm.wav"
''

View File

@@ -1,20 +1,21 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "homep" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "homep" (''
#!/run/current-system/sw/bin/bash
# Ensure the package manifest is generated or updated
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
# Ensure the package manifest is generated or updated
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
echo "Generating Nixpkgs manifest..."
nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt
fi
fi
# Select packages using fzf with multi-select enabled
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
# Select packages using fzf with multi-select enabled
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
# Check if any packages were selected
if [ -n "$selected_packages" ]; then
# Check if any packages were selected
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
# Append each selected package to the Nix config file
sed -i "/^\t]/i \ \t\t$package" "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix"
@@ -29,7 +30,7 @@ if [ -n "$selected_packages" ]; then
esac
done
else
else
echo "No packages selected."
fi
'')
fi
''

View File

@@ -1,12 +1,13 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "homer" ''
#!/run/current-system/sw/bin/bash
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
pkgs.writeShellScriptBin "homer" (''
#!/run/current-system/sw/bin/bash
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix" | sed '1d;$d' | fzf -m)
if [ -n "$selected_packages" ]; then
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
sed -i "/\b$package\b/d" "$HOME/sysflakes/glasshouse-desktop/home/userpkgs.nix"
echo "Removed $package from the Home Manager configuration."
@@ -20,10 +21,10 @@ if [ -n "$selected_packages" ]; then
esac
done
else
else
echo "No packages removed."
fi
fi
'')
''

View File

@@ -1,29 +1,32 @@
{ self, pkgs, host}:
{
self,
pkgs,
host,
}:
pkgs.writeShellScriptBin "nixcommit" ''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
builtin cd "$HOME/sysflakes" || exit
nix flake update
pkgs.writeShellScriptBin "nixcommit" (''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
builtin cd "$HOME/sysflakes" || exit
nix flake update
if [ -n "$2" ]; then
if [ -n "$2" ]; then
echo "too many arguments"
exit
fi
fi
diffcheck=$(git status | grep "working tree clean")
if [ -n "$diffcheck" ]; then
diffcheck=$(git status | grep "working tree clean")
if [ -n "$diffcheck" ]; then
scheck && runbg aplay ${self}/media/sound/warning.wav
echo "Nothing to commit"
exit
fi
fi
git add .
alejandra . &> /dev/null
git add .
# Automatic fixup commit to the most recent commit (HEAD~1)
if [ -z "$1" ]; then
# Automatic fixup commit to the most recent commit (HEAD~1)
if [ -z "$1" ]; then
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
if [ -n "$commits" ]; then
git commit --fixup HEAD
@@ -34,13 +37,13 @@ if [ -z "$1" ]; then
echo "No prior local commits to squash into, please provide a commit message"
exit
fi
else
else
# Generate the system generation number
gen=$(readlink /nix/var/nix/profiles/system | sed 's/.*system-\([0-9]*\)-link/\1/')
gen=$((gen + 1))
git commit -m "(${host}) Gen $gen: $1"
fi
fi
scheck && runbg aplay ${self}/media/sound/gitcommit.wav
builtin cd - || exit
'')
scheck && runbg aplay ${self}/media/sound/gitcommit.wav
builtin cd - || exit
''

View File

@@ -1,20 +1,21 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "nixp" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "nixp" (''
#!/run/current-system/sw/bin/bash
# Ensure the package manifest is generated or updated
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
# Ensure the package manifest is generated or updated
if [ ! -f "/tmp/nixpkgs_manifest.txt" ]; then
echo "Generating Nixpkgs manifest..."
nix-env -qaP 2>/dev/null | awk '{print $1}' | sed 's/nixos\.//' > /tmp/nixpkgs_manifest.txt
fi
fi
# Select packages using fzf with multi-select enabled
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
# Select packages using fzf with multi-select enabled
selected_packages=$(cat /tmp/nixpkgs_manifest.txt | fzf -m)
# Check if any packages were selected
if [ -n "$selected_packages" ]; then
# Check if any packages were selected
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
# Append each selected package to the Nix config file
sed -i "/^\t]/i \ \t\t$package" "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix"
@@ -29,7 +30,7 @@ if [ -n "$selected_packages" ]; then
esac
done
else
else
echo "No packages selected."
fi
'')
fi
''

View File

@@ -1,24 +1,25 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "nixpush" ''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
pushd "$HOME/sysflakes"
pkgs.writeShellScriptBin "nixpush" (''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
pushd "$HOME/sysflakes"
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
if [ -z "$commits" ]; then
commits=$(git log origin/$(git rev-parse --abbrev-ref HEAD)..HEAD --oneline)
if [ -z "$commits" ]; then
scheck && runbg aplay ${self}/media/sound/warning.wav
echo "Nothing to push"
exit
fi
fi
echo "Pushing the following commits upstream on branch '$(git branch | rg "\*" | awk '{print $2}')'"
echo "$commits"
echo "Pushing the following commits upstream on branch '$(git branch | rg "\*" | awk '{print $2}')'"
echo "$commits"
git push
scheck && runbg aplay ${self}/media/sound/gitpush.wav
popd
'')
git push
scheck && runbg aplay ${self}/media/sound/gitpush.wav
popd
''

View File

@@ -1,12 +1,13 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "nixr" ''
#!/run/current-system/sw/bin/bash
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix" | sed '1d;$d' | fzf -m)
pkgs.writeShellScriptBin "nixr" (''
#!/run/current-system/sw/bin/bash
selected_packages=$(sed -n '/\[/,/\]/p' "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix" | sed '1d;$d' | fzf -m)
if [ -n "$selected_packages" ]; then
if [ -n "$selected_packages" ]; then
echo "$selected_packages" | while read -r package; do
sed -i "/\b$package\b/d" "$HOME/sysflakes/glasshouse-desktop/sys/packages.nix"
echo "Removed $package from the Nix configuration."
@@ -20,10 +21,10 @@ if [ -n "$selected_packages" ]; then
esac
done
else
else
echo "No packages removed."
fi
fi
'')
''

View File

@@ -1,8 +1,9 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "nsp" ''
#!/run/current-system/sw/bin/bash
pkgs.writeShellScriptBin "nsp" (''
#!/run/current-system/sw/bin/bash
nix-shell -p "$@" --run zsh
'')
nix-shell -p "$@" --run zsh
''

View File

@@ -1,20 +1,21 @@
{ host, self, pkgs }:
{
host,
self,
pkgs,
}:
pkgs.writeShellScriptBin "rebuild" ''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
pushd "$HOME/sysflakes"
pkgs.writeShellScriptBin "rebuild" (''
#!/run/current-system/sw/bin/bash
scheck && runbg aplay ${self}/media/sound/nixswitch-start.wav
set -e
pushd "$HOME/sysflakes"
nix flake update
git diff
sudo nixos-rebuild switch --flake "$HOME/sysflakes#${host}"
if [ $? -eq 0 ]; then
nix flake update
sudo nixos-rebuild switch --flake "$HOME/sysflakes#${host}"
if [ $? -eq 0 ]; then
scheck && runbg aplay ${self}/media/sound/update.wav
else
else
scheck && runbg aplay ${self}/media/sound/error.wav
fi
popd
'')
fi
popd
''

View File

@@ -1,10 +1,8 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "hyprland" (''
{pkgs, ...}:
pkgs.writeShellScriptBin "hyprland" ''
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
exec Hyprland
'')
''

View File

@@ -1,12 +1,13 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "lofi" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "lofi" (''
#!/usr/bin/env bash
if (ps aux | grep mpv | grep -v grep > /dev/null) then
if (ps aux | grep mpv | grep -v grep > /dev/null) then
pkill mpv
else
else
runbg mpv --no-video https://www.youtube.com/live/jfKfPfyJRdk?si=OF0HKrYFFj33BzMo
fi
'')
fi
''

View File

@@ -1,15 +1,16 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "music" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "music" (''
#!/usr/bin/env bash
if (ps aux | grep audacious | grep -v grep > /dev/null) then
if (ps aux | grep audacious | grep -v grep > /dev/null) then
pkill audacious
else
else
hyprctl dispatch exec "[workspace 5 silent] audacious -t ~/Music/playlist"
sleep 0.5
audtool playlist-repeat-status |grep "on" || audtool playlist-repeat-toggle
audtool playlist-shuffle-status|grep "on" || audtool playlist-shuffle-toggle
fi
'')
fi
''

View File

@@ -1,20 +1,23 @@
{ self, pkgs, ... }:
pkgs.writeShellScriptBin "passhelper" (''
#!/run/current-system/sw/bin/bash
{
self,
pkgs,
...
}:
pkgs.writeShellScriptBin "passhelper" ''
#!/run/current-system/sw/bin/bash
# prevent multiple instances, conditional check happens in the hyprland bind
touch /tmp/passhelperfile
trap "[ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile" EXIT SIGHUP SIGINT
touch /tmp/passhelperfile
trap "[ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile" EXIT SIGHUP SIGINT
# get passwords from password store, remove .password store/ prefix and .gpg suffix, exlude .gpg-id file, open results in fzf
pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | sed 's|^\([^/]*\)|\x1b[32m\1\x1b[0m|' | rg -v "\.git|.gpg-id" | sort -r | fzf --border --border-label="$(whoami)'s keyring" --ansi --layout=reverse)
pass_string=$(find $HOME/.password-store -type f | sed 's|.*/.password-store/||; s|\.gpg$||' | sed 's|^\([^/]*\)|\x1b[32m\1\x1b[0m|' | rg -v "\.git|.gpg-id" | sort -r | fzf --border --border-label="$(whoami)'s keyring" --ansi --layout=reverse)
[ $? = 0 ] || { [ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile; exit 1; }
[ $? = 0 ] || { [ -f /tmp/passhelperfile ] && /run/current-system/sw/bin/rm /tmp/passhelperfile; exit 1; }
# pass it through fmt for soft word wrapping
pass -c "$pass_string" | fmt -w 45
/run/current-system/sw/bin/rm /tmp/passhelperfile
sleep 0.5
exit 0
'')
pass -c "$pass_string" | fmt -w 45
/run/current-system/sw/bin/rm /tmp/passhelperfile
sleep 0.5
exit 0
''

View File

@@ -1,8 +1,9 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "power-menu" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "power-menu" (''
#!/usr/bin/env bash
rofi -show p -modi p:'rofi-power-menu' -theme-str 'window {width: 10em; height: 15em;} listview {lines: 5;}'
'')
rofi -show p -modi p:'rofi-power-menu' -theme-str 'window {width: 10em; height: 15em;} listview {lines: 5;}'
''

View File

@@ -1,20 +1,21 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "shutdown-script" ''
#!/usr/bin/env zsh
respond="$(echo " Shutdown\n Restart\n Cancel" | rofi -dmenu)"
pkgs.writeShellScriptBin "shutdown-script" (''
#!/usr/bin/env zsh
respond="$(echo " Shutdown\n Restart\n Cancel" | rofi -dmenu)"
if [ $respond = ' Shutdown' ]
then
if [ $respond = ' Shutdown' ]
then
echo "shutdown"
shutdown now
elif [ $respond = ' Restart' ]
then
elif [ $respond = ' Restart' ]
then
echo "restart"
reboot
else
else
notify-send "cancel shutdown"
fi
'')
fi
''

View File

@@ -1,8 +1,9 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "switchmon" ''
#!/bin/zsh
pkgs.writeShellScriptBin "switchmon" (''
#!/bin/zsh
hyprctl dispatch focusmonitor $(echo "$(hyprctl -j monitors)" | jq -r '.[] | select(.focused == false) | .name')
'')
hyprctl dispatch focusmonitor $(echo "$(hyprctl -j monitors)" | jq -r '.[] | select(.focused == false) | .name')
''

View File

@@ -1,12 +1,13 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "toggle_blur" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "toggle_blur" (''
#!/usr/bin/env bash
if hyprctl getoption decoration:blur:enabled | grep "int: 1" >/dev/null ; then
if hyprctl getoption decoration:blur:enabled | grep "int: 1" >/dev/null ; then
hyprctl keyword decoration:blur:enabled false >/dev/null
else
else
hyprctl keyword decoration:blur:enabled true >/dev/null
fi
'')
fi
''

View File

@@ -1,10 +1,11 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "toggle_float" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "toggle_float" (''
#!/usr/bin/env bash
hyprctl dispatch togglefloating
hyprctl dispatch resizeactive exact 950 600
hyprctl dispatch centerwindow
'')
hyprctl dispatch togglefloating
hyprctl dispatch resizeactive exact 950 600
hyprctl dispatch centerwindow
''

View File

@@ -1,14 +1,15 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "toggle_oppacity" ''
#!/usr/bin/env bash
pkgs.writeShellScriptBin "toggle_oppacity" (''
#!/usr/bin/env bash
if hyprctl getoption decoration:active_opacity | grep "float: 1" >/dev/null ; then
if hyprctl getoption decoration:active_opacity | grep "float: 1" >/dev/null ; then
hyprctl keyword decoration:active_opacity 0.90 >/dev/null
hyprctl keyword decoration:inactive_opacity 0.90 >/dev/null
else
else
hyprctl keyword decoration:active_opacity 1 >/dev/null
hyprctl keyword decoration:inactive_opacity 1 >/dev/null
fi
'')
fi
''

View File

@@ -1,15 +1,16 @@
{ self, pkgs }:
{
self,
pkgs,
}:
pkgs.writeShellScriptBin "toggle_waybar" ''
#!/usr/bin/env bash
SERVICE=".waybar-wrapped"
pkgs.writeShellScriptBin "toggle_waybar" (''
#!/usr/bin/env bash
SERVICE=".waybar-wrapped"
if pgrep -x "$SERVICE" >/dev/null
then
if pgrep -x "$SERVICE" >/dev/null
then
pkill -9 waybar
else
else
runbg waybar
fi
'')
fi
''

View File

@@ -1,7 +1,5 @@
{ pkgs, ... }:
{
home.packages = (with pkgs; [ swaynotificationcenter ]);
{pkgs, ...}: {
home.packages = with pkgs; [swaynotificationcenter];
xdg.configFile."swaync/style.css".source = ./style.css;
xdg.configFile."swaync/config.json".source = ./config.json;
}

View File

@@ -1,7 +1,6 @@
{ ... }:
{
imports = [ (import ./waybar.nix) ]
++ [ (import ./settings.nix) ]
++ [ (import ./style.nix) ];
{...}: {
imports =
[(import ./waybar.nix)]
++ [(import ./settings.nix)]
++ [(import ./style.nix)];
}

View File

@@ -1,23 +1,21 @@
{ ... }:
{
{...}: {
programs.waybar.settings.mainBar = {
position= "top";
layer= "top";
height= 5;
margin-top= 0;
margin-bottom= 0;
margin-left= 0;
margin-right= 0;
modules-left= [
position = "top";
layer = "top";
height = 5;
margin-top = 0;
margin-bottom = 0;
margin-left = 0;
margin-right = 0;
modules-left = [
"custom/launcher"
"custom/separator"
"hyprland/workspaces"
];
modules-center= [
modules-center = [
"clock"
];
modules-right= [
modules-right = [
"tray"
"custom/separator"
"cpu"
@@ -30,54 +28,54 @@
"custom/separator"
"custom/notification"
];
clock= {
clock = {
calendar = {
format = { today = "<span color='#b4befe'><b><u>{}</u></b></span>"; };
format = {today = "<span color='#b4befe'><b><u>{}</u></b></span>";};
};
format = " {:%H:%M}";
tooltip= "true";
tooltip-format= "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt= " {:%d/%m}";
tooltip = "true";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
format-alt = " {:%d/%m}";
};
"hyprland/workspaces"= {
active-only= false;
disable-scroll= true;
"hyprland/workspaces" = {
active-only = false;
disable-scroll = true;
format = "{icon}";
on-click= "activate";
format-icons= {
"1"= "";
"2"= "";
"3"= "";
"4"= "";
"5"= "";
"6"= "";
urgent= "";
on-click = "activate";
format-icons = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
urgent = "";
default = "";
sort-by-number= true;
sort-by-number = true;
};
persistent-workspaces = {
"1"= [];
"2"= [];
"3"= [];
"4"= [];
"5"= [];
"6"= [];
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
"6" = [];
};
};
memory= {
format= "󰟜 {}%";
format-alt= "󰟜 {used} GiB"; # 
interval= 2;
memory = {
format = "󰟜 {}%";
format-alt = "󰟜 {used} GiB"; # 
interval = 2;
};
cpu= {
format= " {usage}%";
format-alt= " {avg_frequency} GHz";
interval= 2;
cpu = {
format = " {usage}%";
format-alt = " {avg_frequency} GHz";
interval = 2;
};
disk = {
# path = "/";
format = "󰋊 {percentage_used}%";
interval= 60;
interval = 60;
};
network = {
format-wifi = " {signalStrength}%";
@@ -86,19 +84,19 @@
format-linked = "{ifname} (No IP)";
format-disconnected = "󰖪 ";
};
tray= {
icon-size= 20;
spacing= 8;
tray = {
icon-size = 20;
spacing = 8;
};
pulseaudio= {
format= "{icon} {volume}%";
format-muted= " {volume}%";
format-icons= {
default= [" "];
pulseaudio = {
format = "{icon} {volume}%";
format-muted = " {volume}%";
format-icons = {
default = [" "];
};
scroll-step= 5;
on-click= "pamixer -t";
on-click-right= "pavucontrol";
scroll-step = 5;
on-click = "pamixer -t";
on-click-right = "pavucontrol";
};
battery = {
format = "{icon} {capacity}%";
@@ -114,11 +112,11 @@
tooltip = true;
tooltip-format = "{time}";
};
"custom/launcher"= {
format= "";
on-click= "fuzzel";
on-click-right= "wallpaper-picker";
tooltip= "false";
"custom/launcher" = {
format = "";
on-click = "fuzzel";
on-click-right = "wallpaper-picker";
tooltip = "false";
};
"custom/notification" = {
tooltip = false;

View File

@@ -1,6 +1,5 @@
{ ... }:
let custom = {
{...}: let
custom = {
font = "JetBrainsMono Nerd Font";
font_size = "22px";
font_weight = "bold";
@@ -8,9 +7,8 @@ let custom = {
secondary_accent = "#89b4fa";
tertiary_accent = "#f5f5f5";
background = "#11111B";
};
in
{
};
in {
programs.waybar.style = ''
* {

View File

@@ -1,10 +1,8 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.waybar = {
enable = true;
};
programs.waybar.package = pkgs.waybar.overrideAttrs (oa: {
mesonFlags = (oa.mesonFlags or [ ]) ++ [ "-Dexperimental=true" ];
mesonFlags = (oa.mesonFlags or []) ++ ["-Dexperimental=true"];
});
}

View File

@@ -1,13 +1,19 @@
{ inputs, nixpkgs, config, self, username, host, ... }:
{
inputs,
nixpkgs,
config,
self,
username,
host,
...
}: {
imports =
[ (import ./hardware/bootloader.nix) ]
++ [ (import ./hardware/network.nix) ]
++ [ (import ./software/fonts.nix) ]
++ [ (import ./software/sddm.nix) ]
++ [ (import ./software/packages.nix) ]
++ [ (import ./software/programs.nix) ]
++ [ (import ./software/services.nix) ]
++ [ (import ./software/users.nix) ];
[(import ./hardware/bootloader.nix)]
++ [(import ./hardware/network.nix)]
++ [(import ./software/fonts.nix)]
++ [(import ./software/sddm.nix)]
++ [(import ./software/packages.nix)]
++ [(import ./software/programs.nix)]
++ [(import ./software/services.nix)]
++ [(import ./software/users.nix)];
}

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;

View File

@@ -1,18 +1,18 @@
{ host, ... }:
{
{host, ...}: {
networking = {
networkmanager.enable = true;
hostName = if (host == "desktop") then
"argon" else "mercury";
hostName =
if (host == "desktop")
then "argon"
else "mercury";
hosts = {
"192.168.1.163" = [ "glasshaus" ];
"192.168.1.111" = [ "argon" ];
"192.168.1.223" = [ "mercury" ];
"192.168.1.163" = ["glasshaus"];
"192.168.1.111" = ["argon"];
"192.168.1.223" = ["mercury"];
};
firewall = {
enable = true;
allowedTCPPorts = [ 30000 ];
allowedTCPPorts = [30000];
};
};
}

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
fonts.packages = with pkgs; [
times-newer-roman
nerdfonts

View File

@@ -1,7 +1,10 @@
{ pkgs, inputs, ... }:
{
pkgs,
inputs,
...
}: {
environment.systemPackages = with pkgs; [
alejandra
alsa-lib
alsa-utils
bc

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
programs = {
hyprland.enable = true;
zsh.enable = true;

View File

@@ -1,14 +1,19 @@
{ pkgs, self, config, ... }:
{
environment.systemPackages = [(
pkgs,
self,
config,
...
}: {
environment.systemPackages = [
(
pkgs.catppuccin-sddm.override {
flavor="mocha";
font="JetBrains Mono";
fontSize="9";
background="${self}/media/wallpapers/catppuccin/nixos-catppuccin.png";
flavor = "mocha";
font = "JetBrains Mono";
fontSize = "9";
background = "${self}/media/wallpapers/catppuccin/nixos-catppuccin.png";
}
)];
)
];
services.displayManager.sddm = {
enable = true;
wayland.enable = true;

View File

@@ -1,6 +1,4 @@
{ pkgs, ...}:
{
{pkgs, ...}: {
services = {
pipewire = {
enable = true;

View File

@@ -1,18 +1,23 @@
{ config, inputs, pkgs, username, self, host, ... }:
let
nur = config.nur;
in
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
config,
inputs,
pkgs,
username,
self,
host,
...
}: let
nur = config.nur;
in {
imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "backup";
extraSpecialArgs = { inherit self inputs host username nur; };
extraSpecialArgs = {inherit self inputs host username nur;};
users.${username} = {
programs.home-manager.enable = true;
imports = [ ./../../home ];
imports = [./../../home];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
@@ -28,10 +33,10 @@ in
users.users.${username} = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [ "wheel" ];
extraGroups = ["wheel"];
};
security.sudo.extraConfig = ''
${username} ALL=(ALL) NOPASSWD: /run/current-system/sw/bin/nixos-rebuild
'';
nix.settings.allowed-users = [ "${username}" ];
nix.settings.allowed-users = ["${username}"];
}

View File

@@ -2,23 +2,23 @@
autoCmd = [
{
command = "FloatermNew --wintype=float --name=shadeterm --position=topright --autoclose=0 --silent --cwd=<buffer> --titleposition=left zsh";
event = [ "VimEnter" ];
pattern = [ "*" ];
event = ["VimEnter"];
pattern = ["*"];
}
{
command = "silent! mkview";
event = [ "BufWinLeave" ];
pattern = [ "*" ];
event = ["BufWinLeave"];
pattern = ["*"];
}
{
command = "silent! !aplay ~/sound/sys/cd.wav > /dev/null 2>&1 &";
event = [ "BufWinLeave" ];
pattern = [ "*" ];
event = ["BufWinLeave"];
pattern = ["*"];
}
{
command = "silent! loadview";
event = [ "BufWinEnter" ];
pattern = [ "*" ];
event = ["BufWinEnter"];
pattern = ["*"];
}
];
}

View File

@@ -16,4 +16,3 @@
./autocmd.nix
];
}

View File

@@ -2,9 +2,9 @@
plugins.cmp = {
autoEnableSources = true;
settings.sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
{name = "nvim_lsp";}
{name = "path";}
{name = "buffer";}
];
};
}

View File

@@ -1,8 +1,7 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin { # vimwiki
(pkgs.vimUtils.buildVimPlugin {
# vimwiki
name = "vimwiki";
src = pkgs.fetchFromGitHub {
owner = "vimwiki";

View File

@@ -5,8 +5,14 @@
options = {
icons_enabled = true;
theme = "auto";
component_separators = {left = ""; right = "";};
section_separators = {left = ""; right = "";};
component_separators = {
left = "";
right = "";
};
section_separators = {
left = "";
right = "";
};
always_divide_middle = true;
globalstatus = false;
refresh = {
@@ -32,5 +38,5 @@
lualine_z = [];
};
};
};
};
}

View File

@@ -3,9 +3,10 @@
enable = true;
hijackUnnamedBufferWhenOpening = false;
openOnSetup = false;
onAttach = { __raw = ''
onAttach = {
__raw = ''
function(bufnr)
local api = require('nvim-tree.api')
local api = require('nvim-tree.api')
local function opts(desc)
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
@@ -72,7 +73,8 @@ local api = require('nvim-tree.api')
vim.keymap.set('n', '<2-RightMouse>', api.tree.change_root_to_node, opts('CD'))
-- END_DEFAULT_ON_ATTACH
end
''; };
'';
};
view = {
side = "right";
centralizeSelection = true;

View File

@@ -14,14 +14,13 @@
};
};
outputs =
{
outputs = {
nixvim,
flake-parts,
pre-commit-hooks,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"aarch64-linux"
"x86_64-linux"
@@ -29,21 +28,18 @@
"x86_64-darwin"
];
perSystem =
{
perSystem = {
system,
pkgs,
self',
...
}:
let
}: let
nixvim' = nixvim.legacyPackages.${system};
nvim = nixvim'.makeNixvimWithModule {
inherit pkgs;
module = ./config;
};
in
{
in {
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
@@ -65,7 +61,7 @@
packages.default = nvim;
devShells = {
default = with pkgs; mkShell { inherit (self'.checks.pre-commit-check) shellHook; };
default = with pkgs; mkShell {inherit (self'.checks.pre-commit-check) shellHook;};
};
};
};

View File

@@ -5,8 +5,11 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... }@inputs:
let
outputs = {
self,
nixpkgs,
...
} @ inputs: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
@@ -20,7 +23,7 @@
in {
packages.${system} = {
default = pkgs.toilet.overrideAttrs (oldAttrs: rec {
buildInputs = oldAttrs.buildInputs or [] ++ [ extraFonts ];
buildInputs = oldAttrs.buildInputs or [] ++ [extraFonts];
installPhase = ''
make install PREFIX=$out