Switch to nixfmt

This commit is contained in:
SebastianStork 2024-05-19 20:00:58 +02:00
parent 1d70117186
commit b38d2df431
55 changed files with 1559 additions and 1540 deletions

View file

@ -33,14 +33,13 @@
}; };
}; };
outputs = { outputs =
self, { self, nixpkgs, ... }@inputs:
nixpkgs, let
...
} @ inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in
{
nixosConfigurations = { nixosConfigurations = {
north = nixpkgs.lib.nixosSystem { north = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
@ -64,21 +63,8 @@
}; };
}; };
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra.overrideAttrs { devShells.${system}.default = pkgs.mkShell { packages = [ pkgs.sops ]; };
passthru.tests.version = {};
postPatch = ''
substituteInPlace src/alejandra/src/builder.rs \
--replace '2 * build_ctx.indentation' '4 * build_ctx.indentation'
substituteInPlace src/alejandra/src/rules/string.rs \
--replace 'format!(" {}", line)' 'format!(" {}", line)'
substituteInPlace src/alejandra_cli/src/cli.rs \
--replace 'eprint!("{}", random_ad());' ""
rm -r src/alejandra/tests
'';
};
devShells.${system}.default = pkgs.mkShell { formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
packages = [pkgs.sops];
};
}; };
} }

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
imports = [ ../modules/system ]; imports = [ ../modules/system ];
system.stateVersion = "23.11"; system.stateVersion = "23.11";
@ -53,7 +54,8 @@
}) })
]; ];
nixpkgs.config.allowUnfreePredicate = pkg: nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (pkgs.lib.getName pkg) [ builtins.elem (pkgs.lib.getName pkg) [
"steam" "steam"
"steam-original" "steam-original"

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
imports = [ imports = [
../common.nix ../common.nix
./hardware.nix ./hardware.nix

View file

@ -1,4 +1,5 @@
{...}: { { ... }:
{
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95"; device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95";
fsType = "ext4"; fsType = "ext4";

View file

@ -1,4 +1,5 @@
{pkgs, ...}: { { pkgs, ... }:
{
imports = [ imports = [
../common.nix ../common.nix
./hardware.nix ./hardware.nix

View file

@ -4,7 +4,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
imports = [ imports = [
inputs.disko.nixosModules.default inputs.disko.nixosModules.default
./disko.nix ./disko.nix
@ -31,7 +32,8 @@
hardware.nvidia = { hardware.nvidia = {
modesetting.enable = true; modesetting.enable = true;
powerManagement.enable = true; powerManagement.enable = true;
package = let package =
let
rcu_patch = pkgs.fetchpatch { rcu_patch = pkgs.fetchpatch {
url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch";
hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg=";

View file

@ -4,7 +4,8 @@
lib, lib,
wrappers, wrappers,
... ...
}: { }:
{
options.myConfig.clipboard.enable = lib.mkEnableOption ""; options.myConfig.clipboard.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.clipboard.enable { config = lib.mkIf config.myConfig.clipboard.enable {
@ -12,7 +13,9 @@
home.packages = [ home.packages = [
(pkgs.writeScriptBin "clipboard" '' (pkgs.writeScriptBin "clipboard" ''
${lib.getExe pkgs.cliphist} list | ${lib.getExe (wrappers.rofi {inherit (config.myConfig.de) theme;})} -dmenu -display-columns 2 | ${lib.getExe pkgs.cliphist} decode | ${lib.getExe' pkgs.wl-clipboard "wl-copy"} ${lib.getExe pkgs.cliphist} list | ${
lib.getExe (wrappers.rofi { inherit (config.myConfig.de) theme; })
} -dmenu -display-columns 2 | ${lib.getExe pkgs.cliphist} decode | ${lib.getExe' pkgs.wl-clipboard "wl-copy"}
'') '')
]; ];
}; };

View file

@ -3,7 +3,8 @@
lib, lib,
wrappers, wrappers,
... ...
}: { }:
{
options.myConfig.de.hypridlelock.enable = lib.mkEnableOption ""; options.myConfig.de.hypridlelock.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.hypridlelock.enable { config = lib.mkIf config.myConfig.de.hypridlelock.enable {
@ -12,9 +13,11 @@
settings = { settings = {
general = { general = {
lock_cmd = let lock_cmd =
let
hyprlockExe = "${lib.getExe wrappers.hyprlock}"; hyprlockExe = "${lib.getExe wrappers.hyprlock}";
in "pidof ${hyprlockExe} || ${hyprlockExe}"; in
"pidof ${hyprlockExe} || ${hyprlockExe}";
before_sleep_cmd = "loginctl lock-session"; before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on"; after_sleep_cmd = "hyprctl dispatch dpms on";
}; };

View file

@ -3,7 +3,8 @@
lib, lib,
wrappers, wrappers,
... ...
}: { }:
{
config = lib.mkIf config.myConfig.de.hyprland.enable { config = lib.mkIf config.myConfig.de.hyprland.enable {
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;

View file

@ -1,10 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: let
cfg = config.myConfig.de;
in {
imports = [ imports = [
./config.nix ./config.nix
./keybinds.nix ./keybinds.nix

View file

@ -3,7 +3,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
config = lib.mkIf config.myConfig.de.hyprland.enable { config = lib.mkIf config.myConfig.de.hyprland.enable {
wayland.windowManager.hyprland.extraConfig = '' wayland.windowManager.hyprland.extraConfig = ''
# Bindflags: # Bindflags:
@ -54,8 +55,12 @@
bind = SUPER SHIFT, M, togglespecialworkspace, minimize bind = SUPER SHIFT, M, togglespecialworkspace, minimize
# Switch workspace # Switch workspace
${lib.concatMapStringsSep "\n" (n: "bind=SUPER, ${toString n}, workspace, ${toString n}") (lib.range 1 9)} ${lib.concatMapStringsSep "\n" (n: "bind=SUPER, ${toString n}, workspace, ${toString n}") (
${lib.concatMapStringsSep "\n" (n: "bind=SUPER:SHIFT, ${toString n}, movetoworkspacesilent, ${toString n}") (lib.range 1 9)} lib.range 1 9
)}
${lib.concatMapStringsSep "\n" (
n: "bind=SUPER:SHIFT, ${toString n}, movetoworkspacesilent, ${toString n}"
) (lib.range 1 9)}
# Scroll through workspaces # Scroll through workspaces
bind = SUPER, mouse_down, workspace, e-1 bind = SUPER, mouse_down, workspace, e-1
@ -71,14 +76,16 @@
bindl = , switch:on:Lid Switch, exec, systemctl suspend bindl = , switch:on:Lid Switch, exec, systemctl suspend
# Control media # Control media
${let ${
let
play-pause = "${lib.getExe pkgs.playerctl} --ignore-player=brave play-pause"; play-pause = "${lib.getExe pkgs.playerctl} --ignore-player=brave play-pause";
play-next = "${lib.getExe pkgs.playerctl} --ignore-player=brave next"; play-next = "${lib.getExe pkgs.playerctl} --ignore-player=brave next";
play-previous = "${lib.getExe pkgs.playerctl} --ignore-player=brave previous"; play-previous = "${lib.getExe pkgs.playerctl} --ignore-player=brave previous";
mute = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; mute = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
volume-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; volume-up = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
volume-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; volume-down = "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
in '' in
''
bindl = , XF86AudioPlay, exec, ${play-pause} bindl = , XF86AudioPlay, exec, ${play-pause}
bindel = SHIFT, XF86AudioRaiseVolume, exec, ${play-next} bindel = SHIFT, XF86AudioRaiseVolume, exec, ${play-next}
bindel = SHIFT, XF86AudioLowerVolume, exec, ${play-previous} bindel = SHIFT, XF86AudioLowerVolume, exec, ${play-previous}
@ -92,7 +99,8 @@
bindl = SUPER ALT, BACKSPACE, exec, ${mute} bindl = SUPER ALT, BACKSPACE, exec, ${mute}
bindel = SUPER ALT, up, exec, ${volume-up} bindel = SUPER ALT, up, exec, ${volume-up}
bindel = SUPER ALT, down, exec, ${volume-down} bindel = SUPER ALT, down, exec, ${volume-down}
''} ''
}
# Adjust brightness # Adjust brightness
bindel = , XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -e set +2% bindel = , XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -e set +2%

View file

@ -3,9 +3,11 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
cfg = config.myConfig.de; cfg = config.myConfig.de;
in { in
{
options.myConfig.de.theme = lib.mkOption { type = lib.types.str; }; options.myConfig.de.theme = lib.mkOption { type = lib.types.str; };
config = lib.mkMerge [ config = lib.mkMerge [

View file

@ -3,7 +3,8 @@
lib, lib,
wrappers, wrappers,
... ...
}: { }:
{
options.myConfig.de.waybar.enable = lib.mkEnableOption ""; options.myConfig.de.waybar.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.waybar.enable { config = lib.mkIf config.myConfig.de.waybar.enable {

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.equalizer.enable = lib.mkEnableOption ""; options.myConfig.equalizer.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.equalizer.enable { config = lib.mkIf config.myConfig.equalizer.enable {

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.git.enable = lib.mkEnableOption ""; options.myConfig.git.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.git.enable { config = lib.mkIf config.myConfig.git.enable {

View file

@ -1,10 +1,8 @@
{ { config, lib, ... }:
config, let
lib,
...
}: let
cfg = config.myConfig.shell; cfg = config.myConfig.shell;
in { in
{
imports = [ imports = [
./starship.nix ./starship.nix
./enhancement.nix ./enhancement.nix

View file

@ -3,7 +3,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
options.myConfig.shell.enhancement.enable = lib.mkEnableOption ""; options.myConfig.shell.enhancement.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.shell.enhancement.enable { config = lib.mkIf config.myConfig.shell.enhancement.enable {
@ -14,32 +15,75 @@
options = [ "--cmd cd" ]; options = [ "--cmd cd" ];
}; };
home.shellAliases = let home.shellAliases =
lsAliases = let let
lsAliases =
let
listCmd = "${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary"; listCmd = "${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary";
aliasList = lib.mapCartesianProduct ({ aliasList =
lib.mapCartesianProduct
(
{
a, a,
b, b,
c, c,
}: }:
a + b + c) { a + b + c
a = ["ll" "lt" "l"]; )
b = ["" "a"]; {
c = ["" "d" "f"]; a = [
"ll"
"lt"
"l"
];
b = [
""
"a"
];
c = [
""
"d"
"f"
];
}; };
convertAliasToCmd = str: "${listCmd} " + (builtins.replaceStrings ["ll" "lt" "l" "a" "d" "f"] ["--long " "--tree " "--oneline --dereference " "--all " "--only-dirs " "--only-files "] str); convertAliasToCmd =
str:
"${listCmd} "
+ (builtins.replaceStrings
[
"ll"
"lt"
"l"
"a"
"d"
"f"
]
[
"--long "
"--tree "
"--oneline --dereference "
"--all "
"--only-dirs "
"--only-files "
]
str
);
aliasAttrs = lib.genAttrs aliasList convertAliasToCmd; aliasAttrs = lib.genAttrs aliasList convertAliasToCmd;
in in
aliasAttrs // { ls = "l"; }; aliasAttrs // { ls = "l"; };
catAlias = let catAlias =
let
theme = theme =
{ {
dark = ""; dark = "";
light = "GitHub"; light = "GitHub";
} }
.${config.myConfig.de.theme}; .${config.myConfig.de.theme};
in {cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}";}; in
{
cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}";
};
in in
lib.mkMerge [ lib.mkMerge [
lsAliases lsAliases

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.shell.starship.enable = lib.mkEnableOption ""; options.myConfig.shell.starship.enable = lib.mkEnableOption "";
config.programs.starship = lib.mkIf config.myConfig.shell.starship.enable { config.programs.starship = lib.mkIf config.myConfig.shell.starship.enable {

View file

@ -4,7 +4,8 @@
config, config,
lib, lib,
... ...
}: { }:
{
imports = [ inputs.sops-nix.homeManagerModules.sops ]; imports = [ inputs.sops-nix.homeManagerModules.sops ];
options.myConfig.sops.enable = lib.mkEnableOption ""; options.myConfig.sops.enable = lib.mkEnableOption "";

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.ssh-client.enable = lib.mkEnableOption ""; options.myConfig.ssh-client.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.ssh-client.enable { config = lib.mkIf config.myConfig.ssh-client.enable {

View file

@ -4,7 +4,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
options.myConfig.vscode.enable = lib.mkEnableOption ""; options.myConfig.vscode.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vscode.enable { config = lib.mkIf config.myConfig.vscode.enable {
@ -13,9 +14,11 @@
package = pkgs.vscode-with-extensions.override { package = pkgs.vscode-with-extensions.override {
vscode = pkgs.vscodium; vscode = pkgs.vscodium;
vscodeExtensions = let vscodeExtensions =
let
open-ext = inputs.nix-vscode-extensions.extensions.${pkgs.system}.open-vsx; open-ext = inputs.nix-vscode-extensions.extensions.${pkgs.system}.open-vsx;
in [ in
[
open-ext.jnoortheen.nix-ide open-ext.jnoortheen.nix-ide
open-ext.yzhang.markdown-all-in-one open-ext.yzhang.markdown-all-in-one
@ -25,8 +28,10 @@
}; };
}; };
systemd.user.tmpfiles.rules = let systemd.user.tmpfiles.rules =
settings = builtins.replaceStrings [","] [",\\n"] (builtins.toJSON { let
settings = builtins.replaceStrings [ "," ] [ ",\\n" ] (
builtins.toJSON {
"workbench.colorTheme" = "workbench.colorTheme" =
{ {
dark = "GitHub Dark"; dark = "GitHub Dark";
@ -50,8 +55,10 @@
"editor.minimap.enabled" = false; "editor.minimap.enabled" = false;
"window.menuBarVisibility" = "toggle"; "window.menuBarVisibility" = "toggle";
"workbench.editor.decorations.colors" = false; "workbench.editor.decorations.colors" = false;
}); }
in [ );
in
[
"f+ %h/.config/VSCodium/User/settings.json - - - - ${settings}" "f+ %h/.config/VSCodium/User/settings.json - - - - ${settings}"
"f+ %h/.config/VSCodium/User/settings-default.json - - - - ${settings}" "f+ %h/.config/VSCodium/User/settings-default.json - - - - ${settings}"
]; ];

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.bluetooth.enable = lib.mkEnableOption ""; options.myConfig.bluetooth.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.bluetooth.enable { config = lib.mkIf config.myConfig.bluetooth.enable {

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.boot-loader = { options.myConfig.boot-loader = {
systemd-boot.enable = lib.mkEnableOption ""; systemd-boot.enable = lib.mkEnableOption "";
silent = lib.mkEnableOption ""; silent = lib.mkEnableOption "";

View file

@ -3,9 +3,11 @@
config, config,
lib, lib,
... ...
}: let }:
let
cfg = config.myConfig.comma; cfg = config.myConfig.comma;
in { in
{
imports = [ inputs.nix-index-database.nixosModules.nix-index ]; imports = [ inputs.nix-index-database.nixosModules.nix-index ];
options.myConfig.comma.enable = lib.mkEnableOption ""; options.myConfig.comma.enable = lib.mkEnableOption "";

View file

@ -3,7 +3,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
options.myConfig.de.hyprland.enable = lib.mkEnableOption ""; options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.de.hyprland.enable { config = lib.mkIf config.myConfig.de.hyprland.enable {

View file

@ -3,9 +3,11 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
let
cfg = config.myConfig.dm; cfg = config.myConfig.dm;
in { in
{
options.myConfig.dm = { options.myConfig.dm = {
gdm.enable = lib.mkEnableOption ""; gdm.enable = lib.mkEnableOption "";
tuigreet.enable = lib.mkEnableOption ""; tuigreet.enable = lib.mkEnableOption "";
@ -20,9 +22,11 @@ in {
services.greetd = lib.mkIf cfg.tuigreet.enable { services.greetd = lib.mkIf cfg.tuigreet.enable {
enable = true; enable = true;
settings = { settings = {
default_session = let default_session =
let
base = config.services.xserver.displayManager.sessionData.desktops; base = config.services.xserver.displayManager.sessionData.desktops;
in { in
{
command = "${lib.getExe pkgs.greetd.tuigreet} --time --asterisks --remember --remember-user-session --sessions ${base}/share/wayland-sessions:${base}/share/xsessions"; command = "${lib.getExe pkgs.greetd.tuigreet} --time --asterisks --remember --remember-user-session --sessions ${base}/share/wayland-sessions:${base}/share/xsessions";
user = "greeter"; user = "greeter";
}; };

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.flatpak.enable = lib.mkEnableOption ""; options.myConfig.flatpak.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.flatpak.enable { config = lib.mkIf config.myConfig.flatpak.enable {

View file

@ -1,10 +1,8 @@
{ { config, lib, ... }:
config, let
lib,
...
}: let
cfg = config.myConfig.nix-helper; cfg = config.myConfig.nix-helper;
in { in
{
options.myConfig.nix-helper = { options.myConfig.nix-helper = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
auto-gc.enable = lib.mkEnableOption ""; auto-gc.enable = lib.mkEnableOption "";
@ -13,9 +11,11 @@ in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
programs.nh.enable = true; programs.nh.enable = true;
environment.shellAliases = let environment.shellAliases =
let
rebuild = "sudo -v && nh os"; rebuild = "sudo -v && nh os";
in { in
{
nrs = "${rebuild} switch"; nrs = "${rebuild} switch";
nrt = "${rebuild} test"; nrt = "${rebuild} test";
nrb = "${rebuild} boot"; nrb = "${rebuild} boot";

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.printing.enable = lib.mkEnableOption ""; options.myConfig.printing.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.printing.enable { config = lib.mkIf config.myConfig.printing.enable {

View file

@ -4,7 +4,8 @@
config, config,
lib, lib,
... ...
}: { }:
{
imports = [ inputs.sops-nix.nixosModules.sops ]; imports = [ inputs.sops-nix.nixosModules.sops ];
options.myConfig.sops.enable = lib.mkEnableOption ""; options.myConfig.sops.enable = lib.mkEnableOption "";

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.sound.enable = lib.mkEnableOption ""; options.myConfig.sound.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.sound.enable { config = lib.mkIf config.myConfig.sound.enable {

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.syncthing.enable = lib.mkEnableOption ""; options.myConfig.syncthing.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.syncthing.enable { config = lib.mkIf config.myConfig.syncthing.enable {
@ -22,7 +19,8 @@
inspiron.id = "GUXHL6J-J2HWYNN-7JZJ5CN-6LPYGJD-H7GYRLQ-ORZ4PJJ-5K4WT7I-MELMIQO"; inspiron.id = "GUXHL6J-J2HWYNN-7JZJ5CN-6LPYGJD-H7GYRLQ-ORZ4PJJ-5K4WT7I-MELMIQO";
}; };
folders = let folders =
let
allDevices = [ allDevices = [
"north" "north"
"inspiron" "inspiron"
@ -34,7 +32,8 @@
maxAge = "15552000"; # 180 days in seconds maxAge = "15552000"; # 180 days in seconds
}; };
}; };
in { in
{
Documents = { Documents = {
path = "/home/seb/Documents"; path = "/home/seb/Documents";
devices = allDevices; devices = allDevices;

View file

@ -3,7 +3,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
options.myConfig.vm.qemu.enable = lib.mkEnableOption ""; options.myConfig.vm.qemu.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vm.qemu.enable { config = lib.mkIf config.myConfig.vm.qemu.enable {

View file

@ -1,8 +1,5 @@
{ config, lib, ... }:
{ {
config,
lib,
...
}: {
options.myConfig.vpn.lgs.enable = lib.mkEnableOption ""; options.myConfig.vpn.lgs.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.vpn.lgs.enable { config = lib.mkIf config.myConfig.vpn.lgs.enable {

View file

@ -3,7 +3,8 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
options.myConfig.wlan.enable = lib.mkEnableOption ""; options.myConfig.wlan.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.wlan.enable { config = lib.mkIf config.myConfig.wlan.enable {

View file

@ -1,8 +1,5 @@
{ self, inputs, ... }:
{ {
self,
inputs,
...
}: {
imports = [ inputs.home-manager.nixosModules.home-manager ]; imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = { home-manager = {

View file

@ -1,8 +1,5 @@
{ pkgs, lib, ... }:
{ {
pkgs,
lib,
...
}: {
imports = [ ./default.nix ]; imports = [ ./default.nix ];
home-manager.users.seb = { home-manager.users.seb = {

View file

@ -1,8 +1,5 @@
{ pkgs, lib, ... }:
{ {
pkgs,
lib,
...
}: {
imports = [ ./default.nix ]; imports = [ ./default.nix ];
home-manager.users.seb = { home-manager.users.seb = {

View file

@ -1,4 +1,5 @@
{config, ...}: { { config, ... }:
{
imports = [ ../common.nix ]; imports = [ ../common.nix ];
sops.secrets.seb-password.neededForUsers = true; sops.secrets.seb-password.neededForUsers = true;

View file

@ -4,7 +4,8 @@
osConfig, osConfig,
wrappers, wrappers,
... ...
}: { }:
{
xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
myConfig = { myConfig = {

View file

@ -1,8 +1,4 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.bottom; basePackage = pkgs.bottom;
flags = [ "--group" ]; flags = [ "--group" ];

View file

@ -3,19 +3,22 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
assembleWrapper = wrapperConfig: let
assembleWrapper =
wrapperConfig:
(inputs.wrapper-manager.lib { (inputs.wrapper-manager.lib {
inherit pkgs; inherit pkgs;
modules = [ { wrappers.wrappedPackage = wrapperConfig; } ]; modules = [ { wrappers.wrappedPackage = wrapperConfig; } ];
}) }).config.wrappers.wrappedPackage.wrapped;
.config in
.wrappers {
.wrappedPackage
.wrapped;
in {
_module.args.wrappers = lib.pipe (builtins.readDir ./.) [ _module.args.wrappers = lib.pipe (builtins.readDir ./.) [
(lib.filterAttrs (name: value: name != "default.nix")) (lib.filterAttrs (name: value: name != "default.nix"))
(lib.concatMapAttrs (name: _: {${lib.removeSuffix ".nix" name} = import ./${name} {inherit assembleWrapper pkgs lib;};})) (lib.concatMapAttrs (
name: _: {
${lib.removeSuffix ".nix" name} = import ./${name} { inherit assembleWrapper pkgs lib; };
}
))
]; ];
} }

View file

@ -1,12 +1,9 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.hyprlock; basePackage = pkgs.hyprlock;
flags = let flags =
let
hyprlock-config = pkgs.writeText "hyprlock-config" '' hyprlock-config = pkgs.writeText "hyprlock-config" ''
background { background {
monitor = monitor =
@ -18,7 +15,8 @@ assembleWrapper {
monitor = monitor =
} }
''; '';
in [ in
[
"--config" "--config"
hyprlock-config hyprlock-config
]; ];

View file

@ -1,18 +1,16 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.hyprpaper; basePackage = pkgs.hyprpaper;
flags = let flags =
let
hyprpaper-config = pkgs.writeText "hyprpaper-config" '' hyprpaper-config = pkgs.writeText "hyprpaper-config" ''
preload = ~/Pictures/.wallpaper preload = ~/Pictures/.wallpaper
wallpaper = , ~/Pictures/.wallpaper wallpaper = , ~/Pictures/.wallpaper
splash = false splash = false
''; '';
in [ in
[
"--config" "--config"
hyprpaper-config hyprpaper-config
]; ];

View file

@ -3,19 +3,22 @@
pkgs, pkgs,
lib, lib,
... ...
}: {theme ? "dark"}: }:
{
theme ? "dark",
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.kitty; basePackage = pkgs.kitty;
flags = let flags =
let
toKittyConfig = lib.generators.toKeyValue { toKittyConfig = lib.generators.toKeyValue {
mkKeyValue = key: value: let mkKeyValue =
value' = ( key: value:
if lib.isBool value let
then lib.hm.booleans.yesNo value value' = (if lib.isBool value then lib.hm.booleans.yesNo value else toString value);
else toString value in
); "${key} ${value'}";
in "${key} ${value'}";
}; };
kitty-config = pkgs.writeText "kitty-config" (toKittyConfig { kitty-config = pkgs.writeText "kitty-config" (toKittyConfig {
font_family = "JetBrainsMono Nerd Font"; font_family = "JetBrainsMono Nerd Font";
@ -25,12 +28,15 @@ assembleWrapper {
update_check_interval = 0; update_check_interval = 0;
cursor_shape = "beam"; cursor_shape = "beam";
}); });
kitty-theme = pkgs.writeText "kitty-theme" "include ${pkgs.kitty-themes}/share/kitty-themes/themes/${{ kitty-theme = pkgs.writeText "kitty-theme" "include ${pkgs.kitty-themes}/share/kitty-themes/themes/${
{
dark = "default.conf"; dark = "default.conf";
light = "GitHub_Light.conf"; light = "GitHub_Light.conf";
} }
.${theme}}"; .${theme}
in [ }";
in
[
"--config" "--config"
kitty-config kitty-config
"--config" "--config"

View file

@ -1,8 +1,4 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.marktext; basePackage = pkgs.marktext;
flags = [ "--disable-gpu" ]; flags = [ "--disable-gpu" ];

View file

@ -1,8 +1,4 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.obsidian; basePackage = pkgs.obsidian;
flags = [ "--disable-gpu" ]; flags = [ "--disable-gpu" ];

View file

@ -3,19 +3,27 @@
pkgs, pkgs,
lib, lib,
... ...
}: {theme ? "dark"}: }:
{
theme ? "dark",
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.rofi-wayland; basePackage = pkgs.rofi-wayland;
flags = let flags =
let
color-file = color-file =
{ {
dark = ./dark.rasi; dark = ./dark.rasi;
light = ./light.rasi; light = ./light.rasi;
} }
.${theme}; .${theme};
rofi-config = pkgs.concatText "rofi-config" [./config.rasi color-file]; rofi-config = pkgs.concatText "rofi-config" [
in [ ./config.rasi
color-file
];
in
[
"-config" "-config"
rofi-config rofi-config
]; ];

View file

@ -1,8 +1,4 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.spotify; basePackage = pkgs.spotify;
flags = [ "--disable-gpu" ]; flags = [ "--disable-gpu" ];

View file

@ -1,12 +1,9 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.waybar; basePackage = pkgs.waybar;
flags = let flags =
let
waybar-config = (pkgs.formats.json { }).generate "waybar-config" { waybar-config = (pkgs.formats.json { }).generate "waybar-config" {
layer = "top"; layer = "top";
position = "bottom"; position = "bottom";
@ -107,7 +104,8 @@ assembleWrapper {
font-size: 15px; font-size: 15px;
} }
''; '';
in [ in
[
"--config" "--config"
waybar-config waybar-config
"--style" "--style"

View file

@ -1,8 +1,4 @@
{ { assembleWrapper, pkgs, ... }:
assembleWrapper,
pkgs,
...
}:
assembleWrapper { assembleWrapper {
basePackage = pkgs.webcord; basePackage = pkgs.webcord;
flags = [ "--disable-gpu" ]; flags = [ "--disable-gpu" ];