refactor: replace 'with' with attrValues
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-08-31 19:16:06 -04:00
parent b47c11362d
commit 194c140dc1
56 changed files with 655 additions and 588 deletions

View file

@ -71,12 +71,15 @@
}; };
boot.supportedFilesystems = ["ext4" "xfs" "btrfs" "vfat" "ntfs"]; boot.supportedFilesystems = ["ext4" "xfs" "btrfs" "vfat" "ntfs"];
system.fsPackages = with pkgs; [ system.fsPackages = builtins.attrValues {
inherit
(pkgs)
btrfs-progs btrfs-progs
nfs-utils nfs-utils
ntfs3g ntfs3g
xfsprogs xfsprogs
]; ;
};
environment.variables.NPM_CONFIG_GLOBALCONFIG = "/etc/npmrc"; environment.variables.NPM_CONFIG_GLOBALCONFIG = "/etc/npmrc";
environment.etc.npmrc.text = '' environment.etc.npmrc.text = ''
@ -85,13 +88,16 @@
''; '';
environment.systemPackages = environment.systemPackages =
(with pkgs; [ (builtins.attrValues {
# Peripherals # Peripherals
inherit
(pkgs)
hdparm hdparm
pciutils pciutils
usbutils usbutils
rar rar
]) ;
})
++ [ ++ [
nix-melt.packages.${pkgs.system}.default nix-melt.packages.${pkgs.system}.default

View file

@ -46,9 +46,9 @@
config.theme = "dracula-bat"; config.theme = "dracula-bat";
themes.dracula-bat.src = self.legacyPackages.${pkgs.system}.dracula.bat; themes.dracula-bat.src = self.legacyPackages.${pkgs.system}.dracula.bat;
extraPackages = with pkgs.bat-extras; [ extraPackages = builtins.attrValues {
batman inherit (pkgs.bat-extras) batman;
]; };
}; };
}; };
} }

View file

@ -59,10 +59,10 @@ in {
}; };
}; };
home.packages = with pkgs; [ home.packages = [
(writeShellApplication { (pkgs.writeShellApplication {
name = "chore"; name = "chore";
runtimeInputs = [git]; runtimeInputs = [pkgs.git];
text = '' text = ''
DIR=''${1:-"$FLAKE"} DIR=''${1:-"$FLAKE"}

View file

@ -2,9 +2,7 @@
config, config,
pkgs, pkgs,
... ...
}: let }: {
inherit (pkgs) vimPlugins;
in {
imports = [ imports = [
./git.nix ./git.nix
./langs ./langs
@ -63,11 +61,11 @@ in {
''; '';
plugins = [ plugins = [
vimPlugins.fzfWrapper pkgs.vimPlugins.fzfWrapper
vimPlugins.fzf-vim pkgs.vimPlugins.fzf-vim
{ {
plugin = vimPlugins.todo-comments-nvim; plugin = pkgs.vimPlugins.todo-comments-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua
@ -76,7 +74,7 @@ in {
''; '';
} }
{ {
plugin = vimPlugins.mini-nvim; plugin = pkgs.vimPlugins.mini-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua

View file

@ -1,13 +1,11 @@
{pkgs, ...}: let {pkgs, ...}: {
inherit (pkgs) vimPlugins;
in {
programs = { programs = {
neovim = { neovim = {
plugins = [ plugins = [
vimPlugins.fugitive pkgs.vimPlugins.fugitive
{ {
plugin = vimPlugins.gitsigns-nvim; plugin = pkgs.vimPlugins.gitsigns-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua

View file

@ -4,6 +4,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib) getExe mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
in { in {
programs = { programs = {
@ -18,13 +19,13 @@ in {
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
extraPackages = lib.mkIf neovimIde [ extraPackages = mkIf neovimIde [
pkgs.nodePackages.bash-language-server pkgs.nodePackages.bash-language-server
pkgs.shellcheck pkgs.shellcheck
]; ];
extraLuaConfig = extraLuaConfig =
lib.mkIf neovimIde mkIf neovimIde
# lua # lua
'' ''
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
@ -37,7 +38,7 @@ in {
settings = { settings = {
bashIde = { bashIde = {
shellcheckPath = '${lib.getExe pkgs.shellcheck}', shellcheckPath = '${getExe pkgs.shellcheck}',
}, },
}, },
}); });

View file

@ -4,17 +4,20 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
extraPackages = with pkgs; [ extraPackages = builtins.attrValues {
inherit
(pkgs)
gcc gcc
clang-tools clang-tools
cmake-language-server cmake-language-server
]; ;
};
extraLuaConfig = extraLuaConfig =
# lua # lua
@ -41,9 +44,9 @@ in
}); });
''; '';
plugins = [ plugins = builtins.attrValues {
vimPlugins.clangd_extensions-nvim inherit (pkgs.vimPlugins) clangd_extensions-nvim;
]; };
}; };
}; };
} }

View file

@ -4,9 +4,8 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) fileContents mkBefore mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins;
inherit (lib) fileContents;
in { in {
imports = [ imports = [
./bash.nix ./bash.nix
@ -22,10 +21,10 @@ in {
./web.nix ./web.nix
]; ];
programs = lib.mkIf neovimIde { programs = mkIf neovimIde {
neovim = { neovim = {
extraLuaConfig = extraLuaConfig =
lib.mkBefore mkBefore
# lua # lua
'' ''
-- Start completion / snippet stuff -- Start completion / snippet stuff
@ -69,30 +68,34 @@ in {
''; '';
plugins = plugins =
(with vimPlugins; [ (builtins.attrValues {
inherit
(pkgs.vimPlugins)
nvim-lspconfig nvim-lspconfig
lsp-status-nvim lsp-status-nvim
lsp_lines-nvim lsp_lines-nvim
cmp-buffer cmp-buffer
cmp-nvim-lsp cmp-nvim-lsp
cmp-path cmp-path
cmp-spell cmp-spell
vim-vsnip vim-vsnip
]) ;
})
++ [ ++ [
{ {
plugin = vimPlugins.nvim-cmp; plugin = pkgs.vimPlugins.nvim-cmp;
type = "lua"; type = "lua";
config = fileContents ../plugins/cmp.lua; config = fileContents ../plugins/cmp.lua;
} }
{ {
plugin = vimPlugins.nvim-autopairs; plugin = pkgs.vimPlugins.nvim-autopairs;
type = "lua"; type = "lua";
config = config =
# lua # lua
"require('nvim-autopairs').setup({})"; ''
require('nvim-autopairs').setup({});
'';
} }
]; ];
}; };

View file

@ -3,9 +3,10 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
extraLuaConfig = extraLuaConfig =

View file

@ -4,13 +4,13 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (pkgs) vimPlugins; inherit (lib) getExe mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
javaSdk = pkgs.temurin-bin-17; javaSdk = pkgs.temurin-bin-17;
javaPkgs = with pkgs; [gradle maven]; javaPkgs = builtins.attrValues {inherit (pkgs) gradle maven;};
in in
lib.mkIf neovimIde { mkIf neovimIde {
home.packages = javaPkgs; home.packages = javaPkgs;
xdg.dataFile.".gradle/gradle.properties".text = '' xdg.dataFile.".gradle/gradle.properties".text = ''
@ -38,7 +38,7 @@ in
plugins = [ plugins = [
{ {
# TOOD: setup debugger https://github.com/mfussenegger/nvim-jdtls#debugger-via-nvim-dap # TOOD: setup debugger https://github.com/mfussenegger/nvim-jdtls#debugger-via-nvim-dap
plugin = vimPlugins.nvim-jdtls; plugin = pkgs.vimPlugins.nvim-jdtls;
type = "lua"; type = "lua";
config = config =
# lua # lua
@ -48,7 +48,7 @@ in
local config = { local config = {
capabilities = require('cmp_nvim_lsp').default_capabilities(), capabilities = require('cmp_nvim_lsp').default_capabilities(),
cmd = { '${lib.getExe pkgs.jdt-language-server}' }, cmd = { '${getExe pkgs.jdt-language-server}' },
root_dir = vim.fs.dirname(vim.fs.find( root_dir = vim.fs.dirname(vim.fs.find(
{ 'gradlew', '.git', 'mvnw', 'pom.xml' }, { 'gradlew', '.git', 'mvnw', 'pom.xml' },
{ upward = true } { upward = true }

View file

@ -4,15 +4,19 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
extraPackages = [ extraPackages = builtins.attrValues {
pkgs.vscode-langservers-extracted inherit
pkgs.yaml-language-server (pkgs)
]; vscode-langservers-extracted
yaml-language-server
;
};
extraLuaConfig = extraLuaConfig =
# lua # lua

View file

@ -4,21 +4,21 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins;
flakeEnv = config.programs.bash.sessionVariables.FLAKE; flakeEnv = config.programs.bash.sessionVariables.FLAKE;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
extraPackages = [ extraPackages = builtins.attrValues {
pkgs.lua-language-server inherit (pkgs) lua-language-server;
]; };
plugins = [ plugins = [
{ {
plugin = vimPlugins.neodev-nvim; plugin = pkgs.vimPlugins.neodev-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua

View file

@ -6,22 +6,23 @@
vimplugin-easytables-src, vimplugin-easytables-src,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins;
inherit (import "${self}/lib" {inherit pkgs;}) buildPlugin; inherit (import "${self}/lib" {inherit pkgs;}) buildPlugin;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
extraPackages = [ extraPackages = builtins.attrValues {
pkgs.pandoc inherit
(pkgs)
# LaTeX packages pandoc
pkgs.texlab texlab
pkgs.texliveFull texliveFull
pkgs.rubber rubber
]; ;
};
extraLuaConfig = extraLuaConfig =
# lua # lua
@ -56,7 +57,7 @@ in
} }
{ {
plugin = vimPlugins.knap; plugin = pkgs.vimPlugins.knap;
type = "lua"; type = "lua";
config = config =
# lua # lua

View file

@ -6,8 +6,8 @@
self, self,
... ...
}: let }: let
inherit (lib) getExe hasPrefix mkIf removePrefix;
inherit (config.vars) hostName mainUser neovimIde; inherit (config.vars) hostName mainUser neovimIde;
inherit (lib) getExe hasPrefix removePrefix;
defaultFormatter = self.formatter.${pkgs.system}; defaultFormatter = self.formatter.${pkgs.system};
@ -16,7 +16,7 @@
flakeEnv = config.programs.bash.sessionVariables.FLAKE; flakeEnv = config.programs.bash.sessionVariables.FLAKE;
flakeDir = "${removePrefix "/home/${mainUser}/" flakeEnv}"; flakeDir = "${removePrefix "/home/${mainUser}/" flakeEnv}";
in in
lib.mkIf neovimIde { mkIf neovimIde {
assertions = [ assertions = [
{ {
assertion = assertion =

View file

@ -4,9 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
withPython3 = true; withPython3 = true;

View file

@ -4,17 +4,21 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
extraPackages = with pkgs; [ extraPackages = builtins.attrValues {
inherit
(pkgs)
cargo cargo
rustc rustc
rust-analyzer rust-analyzer
rustfmt rustfmt
]; ;
};
extraLuaConfig = extraLuaConfig =
# lua # lua

View file

@ -6,23 +6,29 @@
vimplugin-ts-error-translator-src, vimplugin-ts-error-translator-src,
... ...
}: let }: let
inherit (lib) mkIf;
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins;
inherit (import "${self}/lib" {inherit pkgs;}) buildPlugin; inherit (import "${self}/lib" {inherit pkgs;}) buildPlugin;
in in
lib.mkIf neovimIde { mkIf neovimIde {
programs = { programs = {
neovim = { neovim = {
withNodeJs = true; withNodeJs = true;
extraPackages = [ extraPackages = builtins.attrValues {
pkgs.nodejs_latest inherit
pkgs.nodePackages.npm (pkgs)
pkgs.nodePackages.neovim nodejs_latest
vscode-langservers-extracted
;
pkgs.vscode-langservers-extracted inherit
]; (pkgs.nodePackages)
npm
neovim
;
};
extraLuaConfig = extraLuaConfig =
# lua # lua
@ -122,11 +128,11 @@ in
''; '';
plugins = [ plugins = [
vimPlugins.typescript-tools-nvim pkgs.vimPlugins.typescript-tools-nvim
(buildPlugin "ts-error-translator" vimplugin-ts-error-translator-src) (buildPlugin "ts-error-translator" vimplugin-ts-error-translator-src)
{ {
plugin = vimPlugins.package-info-nvim; plugin = pkgs.vimPlugins.package-info-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua

View file

@ -5,20 +5,19 @@
nvim-theme-src, nvim-theme-src,
... ...
}: let }: let
inherit (config.vars) neovimIde;
inherit (lib) fileContents optionals; inherit (lib) fileContents optionals;
inherit (pkgs) vimPlugins; inherit (config.vars) neovimIde;
in { in {
programs = { programs = {
neovim = { neovim = {
extraPackages = with pkgs; [ extraPackages = builtins.attrValues {
bat inherit (pkgs) bat;
]; };
plugins = plugins =
[ [
{ {
plugin = vimPlugins.dracula-nvim.overrideAttrs { plugin = pkgs.vimPlugins.dracula-nvim.overrideAttrs {
src = nvim-theme-src; src = nvim-theme-src;
}; };
type = "lua"; type = "lua";
@ -43,7 +42,7 @@ in {
''; '';
} }
{ {
plugin = vimPlugins.indent-blankline-nvim; plugin = pkgs.vimPlugins.indent-blankline-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua
@ -80,21 +79,21 @@ in {
} }
# Deps of heirline config # Deps of heirline config
vimPlugins.nvim-web-devicons pkgs.vimPlugins.nvim-web-devicons
{ {
plugin = vimPlugins.heirline-nvim; plugin = pkgs.vimPlugins.heirline-nvim;
type = "lua"; type = "lua";
config = fileContents ./plugins/heirline.lua; config = fileContents ./plugins/heirline.lua;
} }
] ]
++ optionals neovimIde [ ++ optionals neovimIde [
{ {
plugin = vimPlugins.neo-tree-nvim; plugin = pkgs.vimPlugins.neo-tree-nvim;
type = "lua"; type = "lua";
config = fileContents ./plugins/neotree.lua; config = fileContents ./plugins/neotree.lua;
} }
{ {
plugin = vimPlugins.codewindow-nvim; plugin = pkgs.vimPlugins.codewindow-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua
@ -123,7 +122,7 @@ in {
''; '';
} }
{ {
plugin = vimPlugins.transparent-nvim; plugin = pkgs.vimPlugins.transparent-nvim;
type = "lua"; type = "lua";
config = config =
# lua # lua

View file

@ -1,11 +1,7 @@
{pkgs, ...}: let {pkgs, ...}: {
inherit (pkgs) vimPlugins; programs.neovim.plugins = [
in {
programs = {
neovim = {
plugins = [
{ {
plugin = vimPlugins.nvim-treesitter-context; plugin = pkgs.vimPlugins.nvim-treesitter-context;
type = "lua"; type = "lua";
config = config =
# lua # lua
@ -20,10 +16,10 @@ in {
''; '';
} }
vimPlugins.nvim-treesitter-textobjects pkgs.vimPlugins.nvim-treesitter-textobjects
{ {
plugin = vimPlugins.nvim-treesitter.withAllGrammars; plugin = pkgs.vimPlugins.nvim-treesitter.withAllGrammars;
type = "lua"; type = "lua";
config = config =
# lua # lua
@ -35,6 +31,4 @@ in {
''; '';
} }
]; ];
};
};
} }

View file

@ -11,7 +11,9 @@
newSession = true; newSession = true;
historyLimit = 30000; historyLimit = 30000;
plugins = with pkgs.tmuxPlugins; [dracula]; plugins = builtins.attrValues {
inherit (pkgs.tmuxPlugins) dracula;
};
extraConfig = extraConfig =
# bash # bash

View file

@ -10,8 +10,9 @@
}; };
}; };
packages = with pkgs; [ packages =
(nerdfonts.override { [
(pkgs.nerdfonts.override {
fonts = [ fonts = [
"JetBrainsMono" "JetBrainsMono"
"Go-Mono" "Go-Mono"
@ -22,6 +23,10 @@
"Noto" "Noto"
]; ];
}) })
]
++ (builtins.attrValues {
inherit
(pkgs)
noto-fonts noto-fonts
noto-fonts-cjk noto-fonts-cjk
noto-fonts-emoji noto-fonts-emoji
@ -30,7 +35,8 @@
meslo-lgs-nf meslo-lgs-nf
jetbrains-mono jetbrains-mono
ubuntu_font_family ubuntu_font_family
]; ;
});
}; };
# Select internationalisation properties. # Select internationalisation properties.

View file

@ -4,17 +4,23 @@
... ...
}: { }: {
environment.systemPackages = environment.systemPackages =
(with self.packages.${pkgs.system}; [ (builtins.attrValues {
inherit
(self.packages.${pkgs.system})
pokemon-colorscripts pokemon-colorscripts
repl repl
]) ;
++ (with pkgs.nodePackages; [
inherit
(pkgs.nodePackages)
undollar undollar
]) ;
++ (with pkgs; [
alejandra inherit (pkgs) alejandra;
# Archiving # Archiving
inherit
(pkgs)
zip zip
unzip unzip
p7zip p7zip
@ -22,35 +28,48 @@
gzip gzip
gnutar gnutar
xz xz
;
# File management # File management
inherit
(pkgs)
findutils findutils
diffutils diffutils
utillinux utillinux
which which
imagemagick imagemagick
;
# Networking # Networking
dig.dnsutils inherit (pkgs.dig) dnsutils;
inherit
(pkgs)
openssh openssh
rsync rsync
wget wget
gnupg gnupg
;
# Misc CLI stuff # Misc CLI stuff
inherit
(pkgs)
killall killall
nix-output-monitor nix-output-monitor
progress progress
tree tree
gnugrep gnugrep
gnused gnused
;
# Expected Stuff # Expected Stuff
inherit
(pkgs)
hostname hostname
man man
perl perl
tzdata tzdata
]) ;
})
++ [ ++ [
# This could help as well: nix derivation show -r /run/current-system # This could help as well: nix derivation show -r /run/current-system
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
@ -63,10 +82,13 @@
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
name = "from"; name = "from";
runtimeInputs = with pkgs; [ runtimeInputs = builtins.attrValues {
inherit
(pkgs)
coreutils coreutils
which which
]; ;
};
text = '' text = ''
for var do for var do

View file

@ -21,11 +21,14 @@
environment.packages = [ environment.packages = [
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
name = "switch"; name = "switch";
runtimeInputs = with pkgs; [ runtimeInputs = builtins.attrValues {
inherit
(pkgs)
coreutils coreutils
nix-output-monitor nix-output-monitor
nvd nvd
]; ;
};
text = '' text = ''
oldProfile=$(realpath /nix/var/nix/profiles/per-user/nix-on-droid/profile) oldProfile=$(realpath /nix/var/nix/profiles/per-user/nix-on-droid/profile)

View file

@ -17,14 +17,18 @@ in {
services.flatpak.enable = true; services.flatpak.enable = true;
services.packagekit.enable = true; services.packagekit.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = builtins.attrValues {
# Misc Apps inherit
(pkgs)
firefox firefox
kdePackages.discover
kdePackages.krfb
# Libs
wl-clipboard wl-clipboard
xclip xclip
]; ;
inherit
(pkgs.kdePackages)
discover
krfb
;
};
} }

View file

@ -46,18 +46,19 @@ defaultSession: {
stateDir = "/home/${mainUser}/.local/share/decky"; # Keep scoped to user stateDir = "/home/${mainUser}/.local/share/decky"; # Keep scoped to user
# https://github.com/Jovian-Experiments/Jovian-NixOS/blob/1171169117f63f1de9ef2ea36efd8dcf377c6d5a/modules/decky-loader.nix#L80-L84 # https://github.com/Jovian-Experiments/Jovian-NixOS/blob/1171169117f63f1de9ef2ea36efd8dcf377c6d5a/modules/decky-loader.nix#L80-L84
extraPackages = with pkgs; [ extraPackages = builtins.attrValues {
# Generic packages inherit
(pkgs)
curl curl
unzip unzip
util-linux util-linux
gnugrep gnugrep
readline
readline.out
procps procps
pciutils pciutils
libpulseaudio libpulseaudio
]; ;
};
}; };
# Takes way too long to shutdown # Takes way too long to shutdown

View file

@ -14,10 +14,13 @@
kernelModules = ["kvm-amd"]; kernelModules = ["kvm-amd"];
# Zenpower for ryzen cpu monitoring # Zenpower for ryzen cpu monitoring
extraModulePackages = with config.boot.kernelPackages; [ extraModulePackages = builtins.attrValues {
inherit
(config.boot.kernelPackages)
v4l2loopback v4l2loopback
zenpower zenpower
]; ;
};
blacklistedKernelModules = ["k10temp"]; blacklistedKernelModules = ["k10temp"];
supportedFilesystems = ["ntfs"]; supportedFilesystems = ["ntfs"];
@ -85,10 +88,13 @@
libvirtd.enable = true; libvirtd.enable = true;
spiceUSBRedirection.enable = true; spiceUSBRedirection.enable = true;
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
qemu qemu
virtiofsd virtiofsd
]; ;
};
nvidia = { nvidia = {
enable = true; enable = true;

View file

@ -2,7 +2,9 @@
# NFS client setup # NFS client setup
services.rpcbind.enable = true; services.rpcbind.enable = true;
boot.supportedFilesystems = ["nfs"]; boot.supportedFilesystems = ["nfs"];
environment.systemPackages = with pkgs; [nfs-utils]; environment.systemPackages = builtins.attrValues {
inherit (pkgs) nfs-utils;
};
systemd.mounts = let systemd.mounts = let
host = "10.0.0.249"; host = "10.0.0.249";

View file

@ -1,8 +1,8 @@
pkgs: pkgs:
pkgs.dockerTools.pullImage { pkgs.dockerTools.pullImage {
imageName = "rssbridge/rss-bridge"; imageName = "rssbridge/rss-bridge";
imageDigest = "sha256:327315251d038d2ddae7eb088569470f52255f8a0cdc4df41eab47dab4624318"; imageDigest = "sha256:ffc5966ca95af2d031a5c7561d3144454898e330a68862bb0299db6349806c25";
sha256 = "03w1jnhxahbvlmnby7c5v47sm1ypz98v0w5inm8bdwi765r7db60"; sha256 = "059qly0brjsh3ch6b2kmsn2rfsvlvayiaqkpiiydr6fyh85ryrvj";
finalImageName = "rssbridge/rss-bridge"; finalImageName = "rssbridge/rss-bridge";
finalImageTag = "latest"; finalImageTag = "latest";
} }

View file

@ -19,9 +19,12 @@ in {
ffmpegPackage = jellyPkgs.jellyfin-ffmpeg; ffmpegPackage = jellyPkgs.jellyfin-ffmpeg;
}; };
environment.systemPackages = with config.services.jellyfin; [ environment.systemPackages = builtins.attrValues {
inherit
(config.services.jellyfin)
finalPackage finalPackage
webPackage webPackage
ffmpegPackage ffmpegPackage
]; ;
};
} }

View file

@ -1,5 +1,5 @@
{pkgs, ...}: let {pkgs, ...}: let
fsPkgs = with pkgs; [mergerfs cifs-utils]; fsPkgs = builtins.attrValues {inherit (pkgs) mergerfs cifs-utils;};
in { in {
system.fsPackages = fsPkgs; system.fsPackages = fsPkgs;
environment.systemPackages = fsPkgs; environment.systemPackages = fsPkgs;

View file

@ -15,11 +15,14 @@ in
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "sub-clean"; name = "sub-clean";
runtimeInputs = with pkgs; [ runtimeInputs = builtins.attrValues {
inherit
(pkgs)
findutils findutils
gnugrep gnugrep
gawk gawk
]; ;
};
text = '' text = ''
exec ${script} "$@" exec ${script} "$@"

View file

@ -2,9 +2,12 @@
pkgs.writeShellApplication { pkgs.writeShellApplication {
name = "convertMkv"; name = "convertMkv";
runtimeInputs = with pkgs; [ runtimeInputs = builtins.attrValues {
inherit
(pkgs)
ffmpeg-full ffmpeg-full
]; ;
};
text = '' text = ''
extension="$1" extension="$1"

View file

@ -13,7 +13,13 @@
kernelModules = ["kvm-amd"]; kernelModules = ["kvm-amd"];
# Zenpower for ryzen cpu monitoring # Zenpower for ryzen cpu monitoring
extraModulePackages = with config.boot.kernelPackages; [zenpower]; extraModulePackages = builtins.attrValues {
inherit
(config.boot.kernelPackages)
zenpower
;
};
blacklistedKernelModules = ["k10temp"]; blacklistedKernelModules = ["k10temp"];
initrd.availableKernelModules = [ initrd.availableKernelModules = [

View file

@ -14,10 +14,13 @@ in {
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
serviceConfig.User = "matt"; serviceConfig.User = "matt";
path = with pkgs; [ path = builtins.attrValues {
inherit
(pkgs)
steam-run steam-run
steamcmd steamcmd
]; ;
};
script = '' script = ''
# Make sure gamePath exists and cd to it # Make sure gamePath exists and cd to it

View file

@ -40,13 +40,18 @@ in {
}; };
path = path =
[nix-fast-buildPkg] [
++ (with pkgs; [ nix-fast-buildPkg
bash
config.nix.package config.nix.package
]
++ (builtins.attrValues {
inherit
(pkgs)
bash
git git
openssh openssh
]); ;
});
script = '' script = ''
cd /tmp cd /tmp

View file

@ -15,10 +15,13 @@
]; ];
kernelModules = ["amdgpu" "kvm-amd" "acpi_call"]; kernelModules = ["amdgpu" "kvm-amd" "acpi_call"];
extraModulePackages = with config.boot.kernelPackages; [ extraModulePackages = builtins.attrValues {
inherit
(config.boot.kernelPackages)
acpi_call acpi_call
zenpower zenpower
]; ;
};
blacklistedKernelModules = ["k10temp"]; blacklistedKernelModules = ["k10temp"];
initrd = { initrd = {
@ -94,10 +97,13 @@
libvirtd.enable = true; libvirtd.enable = true;
waydroid.enable = true; waydroid.enable = true;
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = builtins.attrValues {
inherit
(pkgs)
qemu qemu
powertop powertop
]; ;
};
# enable brightness control # enable brightness control
programs.light.enable = true; programs.light.enable = true;

Binary file not shown.

View file

@ -195,7 +195,9 @@ in {
]; ];
}; };
extensions = with firefoxAddons; [ extensions = builtins.attrValues {
inherit
(firefoxAddons)
auto-refresh-page auto-refresh-page
bitwarden bitwarden
checkmarks-web-ext checkmarks-web-ext
@ -213,7 +215,8 @@ in {
ttv-lol-pro ttv-lol-pro
ublock-origin ublock-origin
undoclosetabbutton undoclosetabbutton
]; ;
};
}; };
}; };
}; };

View file

@ -11,7 +11,13 @@ stdenv.mkDerivation {
src = "${gtk-theme-src}/kde/cursors"; src = "${gtk-theme-src}/kde/cursors";
buildInputs = with pkgs; [hyprcursor xcur2png]; buildInputs = builtins.attrValues {
inherit
(pkgs)
hyprcursor
xcur2png
;
};
installPhase = '' installPhase = ''
hyprcursor-util --extract ./Dracula-cursors hyprcursor-util --extract ./Dracula-cursors

View file

@ -11,10 +11,13 @@ inputs: rec {
"jovian" "jovian"
"nixpkgs-wayland" "nixpkgs-wayland"
]) ])
++ (with inputs.self.overlays; [ ++ (builtins.attrValues {
inherit
(inputs.self.overlays)
broken-packages broken-packages
xdg-desktop-portal-kde xdg-desktop-portal-kde
]); ;
});
}; };
# Function that makes the attrs that make up the specialArgs # Function that makes the attrs that make up the specialArgs
@ -43,10 +46,12 @@ inputs: rec {
home-manager-path = inputs.home-manager.outPath; home-manager-path = inputs.home-manager.outPath;
pkgs = extraSpecialArgs.pkgs; pkgs = extraSpecialArgs.pkgs;
modules = modules = let
inherit (pkgs.lib) mkOption types;
in
[ [
({config, ...}: { ({config, ...}: {
options = with pkgs.lib; { options = {
environment.variables.FLAKE = mkOption { environment.variables.FLAKE = mkOption {
type = with types; nullOr str; type = with types; nullOr str;
}; };

View file

@ -111,23 +111,26 @@ in {
packages = packages =
[ [
(pkgs.callPackage ./clipboard {})
# TODO: replace with matugen # TODO: replace with matugen
self.packages.${pkgs.system}.coloryou self.packages.${pkgs.system}.coloryou
] ]
++ (with pkgs; [ ++ (builtins.attrValues {
# ags inherit
(pkgs)
dart-sass dart-sass
bun bun
playerctl playerctl
(callPackage ./clipboard {})
## gui
pavucontrol # TODO: replace with ags widget pavucontrol # TODO: replace with ags widget
]) ;
++ (optionals cfgDesktop.isTouchscreen (with pkgs; [ })
++ (optionals cfgDesktop.isTouchscreen (builtins.attrValues {
inherit
(pkgs)
lisgd lisgd
ydotool ydotool
])); ;
}));
}; };
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {

View file

@ -51,8 +51,8 @@ in {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = with pkgs; [ extraPortals = [
kdePackages.xdg-desktop-portal-kde pkgs.kdePackages.xdg-desktop-portal-kde
]; ];
config.hyprland = { config.hyprland = {
@ -203,23 +203,27 @@ in {
}; };
# libs # libs
home.packages = with pkgs; [ home.packages =
# tools (builtins.attrValues {
inherit
(pkgs)
bluez-tools bluez-tools
brightnessctl brightnessctl
pulseaudio pulseaudio
alsa-utils alsa-utils
qt5.qtwayland
qt6.qtwayland
libayatana-appindicator libayatana-appindicator
xdg-utils xdg-utils
evtest evtest
glib glib
xorg.xrandr
libinput libinput
xclip xclip
libnotify libnotify
;
})
++ [
pkgs.qt5.qtwayland
pkgs.qt6.qtwayland
pkgs.xorg.xrandr
]; ];
}; };
}; };

View file

@ -3,24 +3,32 @@ self: {pkgs, ...}: {
inherit (self.legacyPackages.${pkgs.system}) mpvScripts; inherit (self.legacyPackages.${pkgs.system}) mpvScripts;
in { in {
# For kdialog-open-files # For kdialog-open-files
home.packages = with pkgs; [ home.packages = [
kdialog pkgs.kdialog
]; ];
programs.mpv = { programs.mpv = {
enable = true; enable = true;
# https://github.com/mpv-player/mpv/wiki/User-Scripts # https://github.com/mpv-player/mpv/wiki/User-Scripts
scripts = with mpvScripts; [ scripts = builtins.attrValues {
inherit
(mpvScripts)
modernx modernx
# Dep of touch-gestures
pointer-event
touch-gestures
# Ctrl + o
kdialog-open-files
persist-properties persist-properties
undo-redo undo-redo
]; ;
# touch-gestures & deps
inherit
(mpvScripts)
pointer-event
touch-gestures
;
# Ctrl + o
inherit (mpvScripts) kdialog-open-files;
};
scriptOpts = { scriptOpts = {
persist_properties = { persist_properties = {

View file

@ -6,8 +6,8 @@
config = let config = let
cfg = config.roles.desktop; cfg = config.roles.desktop;
in { in {
environment.systemPackages = with pkgs; [ environment.systemPackages = [
plasma5Packages.kio-admin pkgs.plasma5Packages.kio-admin
]; ];
# To make it work with firefox # To make it work with firefox
@ -26,20 +26,22 @@
}; };
}; };
home-manager.users.${cfg.user}.home.packages = with pkgs; home-manager.users.${cfg.user}.home.packages = builtins.attrValues {
[ inherit
(pkgs)
gnome-calculator gnome-calculator
] ;
++ (with kdePackages; [ inherit
(pkgs.kdePackages)
kde-cli-tools kde-cli-tools
]) ;
++ (with plasma5Packages; [
inherit
(pkgs.plasma5Packages)
ark ark
kcharselect kcharselect
kdenlive kdenlive
okular okular
# Dolphin & co
dolphin dolphin
dolphin-plugins dolphin-plugins
kdegraphics-thumbnailers kdegraphics-thumbnailers
@ -48,7 +50,8 @@
kio-admin # needs to be both here and in system pkgs kio-admin # needs to be both here and in system pkgs
kio-extras kio-extras
kmime kmime
]); ;
};
}; };
# For accurate stack trace # For accurate stack trace

View file

@ -76,34 +76,57 @@ in {
}; };
home.packages = home.packages =
(with pkgs; [ (builtins.attrValues {
# School # School
inherit (pkgs.hunspellDicts) en_CA;
inherit
(pkgs)
xournalpp xournalpp
virt-manager virt-manager
libreoffice-fresh # TODO: declarative conf? libreoffice-fresh # TODO: declarative conf?
hunspell hunspell
hunspellDicts.en_CA ;
# Apps # Apps
inherit
(pkgs)
protonmail-desktop protonmail-desktop
protonmail-bridge protonmail-bridge
spotifywm spotifywm
photoqt photoqt
nextcloud-client nextcloud-client
prismlauncher prismlauncher
;
# tools
inherit
(pkgs)
wl-color-picker
wl-clipboard
cliphist
grim-hyprland
slurp
satty
;
})
++ [
(jellyfin-flake
.packages
.${pkgs.system}
.jellyfin-media-player
.override {isNvidiaWayland = isNvidia;})
/* /*
Discord themes for Vencord Discord themes for Vencord
https://markchan0225.github.io/RoundedDiscord/RoundedDiscord.theme.css https://markchan0225.github.io/RoundedDiscord/RoundedDiscord.theme.css
https://raw.githubusercontent.com/dracula/BetterDiscord/master/Dracula_Official.theme.css https://raw.githubusercontent.com/dracula/BetterDiscord/master/Dracula_Official.theme.css
*/ */
(discord.override {withVencord = true;}) (pkgs.discord.override {withVencord = true;})
# GParted
(let
inherit (pkgs) writeShellScriptBin libsForQt5 gparted makeWrapper symlinkJoin;
(symlinkJoin {
name = "gparted";
paths = [gparted];
buildInputs = [makeWrapper];
postBuild = let
newWrapper = writeShellScriptBin "Gparted" '' newWrapper = writeShellScriptBin "Gparted" ''
( (
sleep 1.5 sleep 1.5
@ -117,6 +140,12 @@ in {
) & ) &
exec env SUDO_ASKPASS="${libsForQt5.ksshaskpass}/bin/ksshaskpass" sudo -k -EA "${getExe gparted}" "$@" exec env SUDO_ASKPASS="${libsForQt5.ksshaskpass}/bin/ksshaskpass" sudo -k -EA "${getExe gparted}" "$@"
''; '';
in
symlinkJoin {
name = "gparted";
paths = [gparted];
buildInputs = [makeWrapper];
postBuild = let
in '' in ''
mkdir $out/.wrapped mkdir $out/.wrapped
mv $out/bin/gparted $out/.wrapped mv $out/bin/gparted $out/.wrapped
@ -125,21 +154,6 @@ in {
sed -i "s#Exec.*#Exec=$out/bin/gparted %f#" $out/share/applications/gparted.desktop sed -i "s#Exec.*#Exec=$out/bin/gparted %f#" $out/share/applications/gparted.desktop
''; '';
}) })
# tools
wl-color-picker
wl-clipboard
cliphist
grim-hyprland
slurp
satty
])
++ [
(jellyfin-flake
.packages
.${pkgs.system}
.jellyfin-media-player
.override {isNvidiaWayland = isNvidia;})
]; ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {

View file

@ -4,8 +4,9 @@
# Enable CUPS to print documents. # Enable CUPS to print documents.
printing = { printing = {
enable = true; enable = true;
drivers = with pkgs; [
hplip drivers = [
pkgs.hplip
]; ];
}; };
}; };

View file

@ -58,10 +58,13 @@ in {
]; ];
}; };
buildInputs = with pkgs; [ buildInputs = builtins.attrValues {
inherit
(pkgs)
bun bun
dart-sass dart-sass
]; ;
};
buildPhase = '' buildPhase = ''
sass ./scss/greeter.scss style.css sass ./scss/greeter.scss style.css

View file

@ -9,8 +9,8 @@
cfg = osConfig.roles.desktop; cfg = osConfig.roles.desktop;
in { in {
home.packages = with pkgs; [ home.packages = [
gnomeExtensions.user-themes pkgs.gnomeExtensions.user-themes
]; ];
# Gtk settings # Gtk settings

View file

@ -6,7 +6,7 @@ self: {
config = let config = let
wallpaper = toString self.legacyPackages.${pkgs.system}.dracula.wallpaper; wallpaper = toString self.legacyPackages.${pkgs.system}.dracula.wallpaper;
in { in {
home.packages = with pkgs; [hyprpaper]; home.packages = [pkgs.hyprpaper];
xdg.configFile."hypr/hyprpaper.conf" = { xdg.configFile."hypr/hyprpaper.conf" = {
text = lib.hm.generators.toHyprconf { text = lib.hm.generators.toHyprconf {

View file

@ -9,9 +9,9 @@ self: {
cfg = osConfig.roles.desktop; cfg = osConfig.roles.desktop;
in { in {
home.packages = with pkgs; [ home.packages = [
libsForQt5.qtstyleplugin-kvantum pkgs.libsForQt5.qtstyleplugin-kvantum
kdePackages.qtstyleplugin-kvantum pkgs.kdePackages.qtstyleplugin-kvantum
]; ];
qt = { qt = {

View file

@ -38,8 +38,8 @@ in {
}; };
# Script for updating the images of all images of a compose.nix file # Script for updating the images of all images of a compose.nix file
environment.systemPackages = with pkgs; [ environment.systemPackages = [
(callPackage ./updateImage.nix {}) (pkgs.callPackage ./updateImage.nix {})
]; ];
}; };

View file

@ -33,12 +33,15 @@ in {
enable = true; enable = true;
enable32Bit = true; enable32Bit = true;
extraPackages = with pkgs; [ extraPackages = builtins.attrValues {
inherit
(pkgs)
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
nvidia-vaapi-driver nvidia-vaapi-driver
]; ;
extraPackages32 = with pkgs; [vaapiVdpau]; };
extraPackages32 = [pkgs.vaapiVdpau];
}; };
services.xserver.videoDrivers = ["nvidia"]; services.xserver.videoDrivers = ["nvidia"];
@ -71,13 +74,16 @@ in {
environment.systemPackages = environment.systemPackages =
optionals cfg.enableCUDA [pkgs.cudaPackages.cudatoolkit] optionals cfg.enableCUDA [pkgs.cudaPackages.cudatoolkit]
++ (with pkgs; [ ++ (builtins.attrValues {
inherit (pkgs.nvtopPackages) nvidia;
inherit
(pkgs)
libva-utils libva-utils
nvidia-vaapi-driver nvidia-vaapi-driver
nvtopPackages.nvidia
pciutils pciutils
vdpauinfo vdpauinfo
]); ;
});
boot.kernelModules = boot.kernelModules =
optionals cfg.enableCUDA ["nvidia-uvm"] optionals cfg.enableCUDA ["nvidia-uvm"]

View file

@ -129,8 +129,8 @@
devShells = perSystem (pkgs: { devShells = perSystem (pkgs: {
default = pkgs.mkShell { default = pkgs.mkShell {
packages = with pkgs; [ packages = [
(writeShellScriptBin "mkIso" '' (pkgs.writeShellScriptBin "mkIso" ''
isoConfig="nixosConfigurations.live-image.config.system.build.isoImage" isoConfig="nixosConfigurations.live-image.config.system.build.isoImage"
nom build $(realpath /etc/nixos)#$isoConfig nom build $(realpath /etc/nixos)#$isoConfig
'') '')
@ -138,13 +138,24 @@
}; };
node = pkgs.mkShell { node = pkgs.mkShell {
packages = with pkgs; [ packages =
(builtins.attrValues {
inherit
(pkgs)
nodejs_latest nodejs_latest
typescript typescript
;
(writeShellApplication { })
++ [
(pkgs.writeShellApplication {
name = "updateNpmDeps"; name = "updateNpmDeps";
runtimeInputs = [prefetch-npm-deps nodejs_latest]; runtimeInputs = builtins.attrValues {
inherit
(pkgs)
prefetch-npm-deps
nodejs_latest
;
};
text = '' text = ''
npm i --package-lock-only || true # this command will fail but still updates the main lockfile npm i --package-lock-only || true # this command will fail but still updates the main lockfile
@ -155,15 +166,19 @@
}; };
subtitles-dev = pkgs.mkShell { subtitles-dev = pkgs.mkShell {
packages = with pkgs; packages = builtins.attrValues {
[ inherit
(pkgs)
nodejs_latest nodejs_latest
ffmpeg-full ffmpeg-full
typescript typescript
] ;
++ (with nodePackages; [
inherit
(pkgs.nodePackages)
ts-node ts-node
]); ;
};
}; };
}); });

View file

@ -1,94 +1 @@
final: prev: { final: prev: {}
# FIXME: https://pr-tracker.nelim.org/?pr=334866
rubber = prev.python3Packages.buildPythonApplication rec {
pname = "rubber";
version = "1.6.6";
pyproject = true;
src = prev.fetchFromGitLab {
owner = "latex-rubber";
repo = "rubber";
rev = version;
hash = "sha256-C26PN3jyV6qwSjgPem54bykZrpKj+n8iHYYUyR+8dgI=";
};
postPatch = ''
sed -i -e '/texi2dvi/d' hatch_build.py
substituteInPlace tests/run.sh \
--replace-fail /var/tmp /tmp
'';
nativeBuildInputs = [prev.python3Packages.hatchling prev.texinfo];
checkPhase = ''
runHook preCheck
pushd tests >/dev/null
${prev.stdenv.shell} run.sh
popd >/dev/null
runHook postCheck
'';
meta.mainProgram = "rubber";
};
# FIXME: https://pr-tracker.nelim.org/?pr=334814
delta = prev.rustPlatform.buildRustPackage rec {
pname = "delta";
version = "0.17.0-unstable-2024-08-12";
src = prev.fetchFromGitHub {
owner = "dandavison";
repo = pname;
rev = "a01141b72001f4c630d77cf5274267d7638851e4";
hash = "sha256-My51pQw5a2Y2VTu39MmnjGfmCavg8pFqOmOntUildS0=";
};
cargoHash = "sha256-Rlc3Bc6Jh89KLLEWBWQB5GjoeIuHnwIVZN/MVFMjY24=";
nativeBuildInputs = with prev; [
installShellFiles
pkg-config
];
buildInputs = with prev;
[
oniguruma
]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.Foundation
];
nativeCheckInputs = [prev.git];
env.RUSTONIG_SYSTEM_LIBONIG = true;
postInstall = ''
installShellCompletion --cmd delta \
etc/completion/completion.{bash,fish,zsh}
'';
# test_env_parsing_with_pager_set_to_bat sets environment variables,
# which can be flaky with multiple threads:
# https://github.com/dandavison/delta/issues/1660
dontUseCargoParallelTests = true;
checkFlags = with prev;
lib.optionals stdenv.isDarwin [
"--skip=test_diff_same_non_empty_file"
];
meta.mainProgram = "delta";
};
egl-wayland = prev.egl-wayland.overrideAttrs (o: {
version = "1.1.15-f30cb0e";
src = prev.fetchFromGitHub {
owner = "Nvidia";
repo = "egl-wayland";
rev = "f30cb0e4c9a215e933dc8250f5dad4e96d4f2136";
hash = "sha256-EwMj3PqU4yzSucYhx8Yy/MqOwZbfsGkhSA+yNwOh4U0=";
};
});
}

View file

@ -1,11 +1,13 @@
{python3Packages, ...}: {python3Packages, ...}: let
python3Packages.buildPythonPackage { inherit (python3Packages) buildPythonPackage utils material-color-utilities;
in
buildPythonPackage {
pname = "coloryou"; pname = "coloryou";
version = "0.0.1"; version = "0.0.1";
src = ./.; src = ./.;
propagatedBuildInputs = with python3Packages; [utils material-color-utilities]; propagatedBuildInputs = [utils material-color-utilities];
postInstall = '' postInstall = ''
mv -v $out/bin/coloryou.py $out/bin/coloryou mv -v $out/bin/coloryou.py $out/bin/coloryou

View file

@ -1,7 +0,0 @@
with import <nixpkgs> {};
with pkgs.python311Packages;
buildPythonPackage {
name = "coloryou";
src = ./.;
propagatedBuildInputs = [material-color-utilities utils];
}