diff --git a/flake.nix b/flake.nix index 308b8739..46a86675 100644 --- a/flake.nix +++ b/flake.nix @@ -90,11 +90,10 @@ }; }; - outputs = { self, nixpkgs, ... } @ inputs: + outputs = + { self, nixpkgs, ... }@inputs: let - nixcfgLib = import ./lib { - inherit inputs; - }; + nixcfgLib = import ./lib { inherit inputs; }; inherit (inputs.flake-utils.lib.system) aarch64-darwin aarch64-linux x86_64-linux; inherit (nixpkgs.lib) listToAttrs recursiveUpdate; in @@ -102,25 +101,18 @@ { name = "nixcfg"; - lib = { inputs }: - import ./lib { inputs = inputs // self.inputs; }; + lib = { inputs }: import ./lib { inputs = inputs // self.inputs; }; - darwinConfigurations = listToAttrs [ - (mkNixDarwin aarch64-darwin "macos") - ]; + darwinConfigurations = listToAttrs [ (mkNixDarwin aarch64-darwin "macos") ]; homeConfigurations = listToAttrs [ (mkHome x86_64-linux "christian@non-nixos") (mkHome x86_64-linux "demo@non-nixos") ]; - nixosConfigurations = listToAttrs [ - (mkNixos x86_64-linux "nixos") - ]; + nixosConfigurations = listToAttrs [ (mkNixos x86_64-linux "nixos") ]; - nixOnDroidConfigurations = listToAttrs [ - (mkNixOnDroid aarch64-linux "nix-on-droid") - ]; + nixOnDroidConfigurations = listToAttrs [ (mkNixOnDroid aarch64-linux "nix-on-droid") ]; formatter = forEachSystem (system: nixpkgs.legacyPackages."${system}".nixfmt-rfc-style); @@ -131,11 +123,12 @@ _doNotClearPath = true; flakePath = "/home/\$(logname)/.nix-config"; }; - path = pkgs: with pkgs; [ - git - hostname - jq - ]; + path = + pkgs: with pkgs; [ + git + hostname + jq + ]; }) (mkApp "nixos-install" { @@ -143,30 +136,39 @@ envs = { _doNotClearPath = true; }; - path = pkgs: with pkgs; [ - git - hostname - util-linux - parted - cryptsetup - lvm2 - ]; + path = + pkgs: with pkgs; [ + git + hostname + util-linux + parted + cryptsetup + lvm2 + ]; }) ]; - checks = recursiveUpdate - (forEachSystem (system: import ./lib/checks { pkgs = pkgsFor."${system}"; flake = self; })) - ((mkForSystem aarch64-darwin [ - (mkBuild "build-macos" self.darwinConfigurations.macos.system) - ]) // (mkForSystem x86_64-linux [ - (mkBuild "build-christian@non-nixos" self.homeConfigurations."christian@non-nixos".activationPackage) - (mkBuild "build-demo@non-nixos" self.homeConfigurations."demo@non-nixos".activationPackage) - (mkBuild "build-nixos" self.nixosConfigurations.nixos.config.system.build.toplevel) - ])); - - devShells = mkForEachSystem [ - (mkDevShell "default" { flake = self; }) - ]; + checks = + recursiveUpdate + (forEachSystem ( + system: + import ./lib/checks { + pkgs = pkgsFor."${system}"; + flake = self; + } + )) + ( + (mkForSystem aarch64-darwin [ (mkBuild "build-macos" self.darwinConfigurations.macos.system) ]) + // (mkForSystem x86_64-linux [ + (mkBuild "build-christian@non-nixos" + self.homeConfigurations."christian@non-nixos".activationPackage + ) + (mkBuild "build-demo@non-nixos" self.homeConfigurations."demo@non-nixos".activationPackage) + (mkBuild "build-nixos" self.nixosConfigurations.nixos.config.system.build.toplevel) + ]) + ); + + devShells = mkForEachSystem [ (mkDevShell "default" { flake = self; }) ]; # Necessary for nix-tree # Run it using `nix-tree . --impure --derivation` diff --git a/home/base/default.nix b/home/base/default.nix index d8bb4fc7..6c6e881d 100644 --- a/home/base/default.nix +++ b/home/base/default.nix @@ -1,12 +1,15 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { home = { homeDirectory = lib.mkDefault "/home/${config.home.username}"; - sessionPath = [ - "$HOME/bin" - ]; + sessionPath = [ "$HOME/bin" ]; enableNixpkgsReleaseCheck = true; }; diff --git a/home/base/fonts/default.nix b/home/base/fonts/default.nix index ec0d73e9..eb5fbd93 100644 --- a/home/base/fonts/default.nix +++ b/home/base/fonts/default.nix @@ -5,7 +5,5 @@ with pkgs; { fonts.fontconfig.enable = true; - home.packages = [ - corefonts - ]; + home.packages = [ corefonts ]; } diff --git a/home/base/nix/default.nix b/home/base/nix/default.nix index bd028672..eab51160 100644 --- a/home/base/nix/default.nix +++ b/home/base/nix/default.nix @@ -1,9 +1,7 @@ { pkgs, ... }: { - home.packages = [ - pkgs.nix-output-monitor - ]; + home.packages = [ pkgs.nix-output-monitor ]; # Command-not-found replacement programs.nix-index.enable = true; diff --git a/home/base/non-nixos/default.nix b/home/base/non-nixos/default.nix index 93735c28..9c3fcf41 100644 --- a/home/base/non-nixos/default.nix +++ b/home/base/non-nixos/default.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: let @@ -14,7 +19,9 @@ in custom.base.non-nixos = { enable = lib.mkEnableOption "Config for non NixOS systems"; - installNix = lib.mkEnableOption "Nix installation" // { default = true; }; + installNix = lib.mkEnableOption "Nix installation" // { + default = true; + }; }; }; diff --git a/home/base/non-nixos/home-manager/auto-upgrade/default.nix b/home/base/non-nixos/home-manager/auto-upgrade/default.nix index bccc5932..ea256e31 100644 --- a/home/base/non-nixos/home-manager/auto-upgrade/default.nix +++ b/home/base/non-nixos/home-manager/auto-upgrade/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/base/non-nixos/home-manager/default.nix b/home/base/non-nixos/home-manager/default.nix index 4a7cfe08..577c1c4a 100644 --- a/home/base/non-nixos/home-manager/default.nix +++ b/home/base/non-nixos/home-manager/default.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: let @@ -17,9 +22,7 @@ in config = lib.mkIf cfg.enable { home = { - packages = with pkgs; [ - home-manager - ]; + packages = with pkgs; [ home-manager ]; shellAliases = { hm-switch = "home-manager switch -b hm-bak --impure --flake '${flakeBaseDir}'"; diff --git a/home/programs/abcde/default.nix b/home/programs/abcde/default.nix index 73fa8da1..cc6c2f7a 100644 --- a/home/programs/abcde/default.nix +++ b/home/programs/abcde/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/programs/davmail/default.nix b/home/programs/davmail/default.nix index 1bba50a9..883c1d55 100644 --- a/home/programs/davmail/default.nix +++ b/home/programs/davmail/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -6,21 +11,32 @@ let cfg = config.custom.programs.davmail; - configType = with types; - oneOf [ (attrsOf configType) str int bool ] // { + configType = + with types; + oneOf [ + (attrsOf configType) + str + int + bool + ] + // { description = "davmail config type (str, int, bool or attribute set thereof)"; }; toStr = val: if isBool val then boolToString val else toString val; - linesForAttrs = attrs: concatMap - (name: - let value = attrs."${name}"; in - if isAttrs value - then map (line: name + "." + line) (linesForAttrs value) - else [ "${name}=${toStr value}" ] - ) - (attrNames attrs); + linesForAttrs = + attrs: + concatMap ( + name: + let + value = attrs."${name}"; + in + if isAttrs value then + map (line: name + "." + line) (linesForAttrs value) + else + [ "${name}=${toStr value}" ] + ) (attrNames attrs); configFile = pkgs.writeText "davmail.properties" (concatStringsSep "\n" (linesForAttrs cfg.config)); @@ -106,4 +122,4 @@ in home.packages = [ pkgs.davmail ]; }; -} +} diff --git a/home/programs/firefox/default.nix b/home/programs/firefox/default.nix index d0d34a59..36c3c9e6 100644 --- a/home/programs/firefox/default.nix +++ b/home/programs/firefox/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -156,44 +161,64 @@ in default = "Harke Search"; engines = { "${engines.harke}" = { - urls = [{ - template = "https://search.harke.ch/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://search.harke.ch/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = ./icons/search.harke.ch.svg; }; "${engines.nixPkgs}" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@np" ]; }; "${engines.nixOpts}" = { - urls = [{ - template = "https://search.nixos.org/options"; - params = [ - { name = "query"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; definedAliases = [ "@no" ]; }; "${engines.nixWiki}" = { - urls = [{ - template = "https://nixos.wiki/index.php"; - params = [ - { name = "search"; value = "{searchTerms}"; } - ]; - }]; + urls = [ + { + template = "https://nixos.wiki/index.php"; + params = [ + { + name = "search"; + value = "{searchTerms}"; + } + ]; + } + ]; iconUpdateURL = "https://nixos.wiki/favicon.png"; updateInterval = 24 * 60 * 60 * 1000; # every day definedAliases = [ "@nw" ]; diff --git a/home/programs/kmonad/default.nix b/home/programs/kmonad/default.nix index a9957ee4..4b648a12 100644 --- a/home/programs/kmonad/default.nix +++ b/home/programs/kmonad/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -6,24 +11,23 @@ let cfg = config.custom.programs.kmonad; - mkService = kbd-dev: kbd-path: - { - name = "kmonad-${kbd-dev}"; - value = { - Unit = { - Description = "KMonad Instance for: ${kbd-dev}"; - }; - Service = { - Type = "simple"; - Restart = "always"; - RestartSec = 10; - ExecStart = "${lib.getExe cfg.package} ${kbd-path}"; - }; - Install = { - WantedBy = [ "default.target" ]; - }; + mkService = kbd-dev: kbd-path: { + name = "kmonad-${kbd-dev}"; + value = { + Unit = { + Description = "KMonad Instance for: ${kbd-dev}"; + }; + Service = { + Type = "simple"; + Restart = "always"; + RestartSec = 10; + ExecStart = "${lib.getExe cfg.package} ${kbd-path}"; + }; + Install = { + WantedBy = [ "default.target" ]; }; }; + }; in diff --git a/home/programs/lazygit/default.nix b/home/programs/lazygit/default.nix index c5391664..6cdfe1db 100644 --- a/home/programs/lazygit/default.nix +++ b/home/programs/lazygit/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -17,9 +22,7 @@ in config = mkIf cfg.enable { home = { - packages = with pkgs; [ - lazygit - ]; + packages = with pkgs; [ lazygit ]; shellAliases = { lg = "lazygit"; diff --git a/home/programs/logseq/default.nix b/home/programs/logseq/default.nix index 7bbf1ac7..6bce50a5 100644 --- a/home/programs/logseq/default.nix +++ b/home/programs/logseq/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -15,7 +20,5 @@ in }; }; - config = mkIf cfg.enable { - home.packages = [ pkgs.logseq ]; - }; + config = mkIf cfg.enable { home.packages = [ pkgs.logseq ]; }; } diff --git a/home/programs/python/default.nix b/home/programs/python/default.nix index 254c378e..bad4fb17 100644 --- a/home/programs/python/default.nix +++ b/home/programs/python/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/programs/ranger/default.nix b/home/programs/ranger/default.nix index 467d5a80..6bb21de4 100644 --- a/home/programs/ranger/default.nix +++ b/home/programs/ranger/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/programs/ranger/package.nix b/home/programs/ranger/package.nix index 600ce09a..1c4d2492 100644 --- a/home/programs/ranger/package.nix +++ b/home/programs/ranger/package.nix @@ -1,10 +1,11 @@ # https://github.com/realfolk/nix/blob/55a474544508546e70cb229235a3ff024315bd6d/lib/packages/ranger/default.nix -{ lib -, fetchFromGitHub -, python3Packages -, file -, less +{ + lib, + fetchFromGitHub, + python3Packages, + file, + less, }: python3Packages.buildPythonApplication rec { @@ -19,7 +20,12 @@ python3Packages.buildPythonApplication rec { LC_ALL = "en_US.UTF-8"; doCheck = true; - propagatedBuildInputs = [ file python3Packages.astroid python3Packages.pylint python3Packages.pytest ]; + propagatedBuildInputs = [ + file + python3Packages.astroid + python3Packages.pylint + python3Packages.pytest + ]; #++ lib.optionals imagePreviewSupport [ python3Packages.pillow ]; preConfigure = '' diff --git a/home/programs/spectrwm/default.nix b/home/programs/spectrwm/default.nix index cc020362..f62e0c65 100644 --- a/home/programs/spectrwm/default.nix +++ b/home/programs/spectrwm/default.nix @@ -19,7 +19,11 @@ in enable = mkEnableOption "Spectrwm window manager"; modKey = mkOption { - type = types.enum [ "Mod1" "Mod2" "Mod4" ]; + type = types.enum [ + "Mod1" + "Mod2" + "Mod4" + ]; default = "Mod4"; description = '' The window manager mod key. @@ -187,7 +191,7 @@ in # workspace_clamp = 1 # warp_focus = 1 # warp_pointer = 1 - + # Window Decoration border_width = 2 color_focus = white @@ -196,15 +200,15 @@ in # color_unfocus_maximized = rgb:88/88/00 region_padding = 10 tile_gap = 10 - + # Region containment # Distance window must be dragged/resized beyond the region edge before it is # allowed outside the region. # boundary_width = 50 - + # Remove window border when bar is disabled and there is only one window in workspace # disable_border = 1 - + # Bar Settings # bar_enabled = 1 bar_border_width = 4 @@ -230,25 +234,25 @@ in # window_name_enabled = 0 # verbose_layout = 0 # urgent_enabled = 1 - + # Dialog box size ratio when using TRANSSZ quirk; 0.3 < dialog_ratio <= 1.0 # dialog_ratio = 0.6 - + # Split a non-RandR dual head setup into one region per monitor # (non-standard driver-based multihead is not seen by spectrwm) # region = screen[1]:1280x1024+0+0 # region = screen[1]:1280x1024+1280+0 - + # Launch applications in a workspace of choice ${concatStringsSep "\n" (mapAttrsToList mkAutorun cfg.autoruns)} - + # Customize workspace layout at start # format: ws[idx]:master_grow:master_add:stack_inc:always_raise:stack_mode layout = ws[2]:0:0:0:0:max layout = ws[3]:0:0:0:0:max layout = ws[6]:0:0:0:0:max layout = ws[9]:5:0:0:0:vertical - + # Set workspace name at start name = ws[1]:1  name = ws[2]:2  @@ -258,42 +262,44 @@ in name = ws[6]:6  name = ws[9]:9  name = ws[10]:10  - + # Mod key, (Windows key is Mod4) (Apple key on OSX is Mod2) modkey = ${cfg.modKey} - + # This allows you to include pre-defined key bindings for your keyboard layout. # keyboard_mapping = ~/.spectrwm_us.conf bind[rg_next] = MOD+Shift+l bind[rg_prev] = MOD+Shift+h - + # PROGRAMS - + # Validated default programs: program[lock] = ${cfg.locker.lockerCmd} program[term] = alacritty # program[menu] = dmenu_run $dmenu_bottom -fn $bar_font -nb $bar_color -nf $bar_font_color -sb $bar_color_selected -sf $bar_font_color_selected # program[search] = dmenu $dmenu_bottom -i -fn $bar_font -nb $bar_color -nf $bar_font_color -sb $bar_color_selected -sf $bar_font_color_selected # program[name_workspace] = dmenu $dmenu_bottom -p Workspace -fn $bar_font -nb $bar_color -nf $bar_font_color -sb $bar_color_selected -sf $bar_font_color_selected - + # To disable validation of the above, free the respective binding(s): # bind[] = MOD+Shift+Delete # disable lock # bind[] = MOD+Shift+Return # disable term # bind[] = MOD+p # disable menu - + # Optional default programs that will only be validated if you override: program[screenshot_all] = ${config.xdg.configFile."${screenshotFile}".target} full program[screenshot_wind] = ${config.xdg.configFile."${screenshotFile}".target} window bind[screenshot_all] = Print bind[screenshot_wind] = Shift+Print - ${concatStringsSep "\n" (optional (cfg.initscrScript != "") '' - program[initscr] = ${config.xdg.configFile."${initscrFile}".target} - '')} - + ${concatStringsSep "\n" ( + optional (cfg.initscrScript != "") '' + program[initscr] = ${config.xdg.configFile."${initscrFile}".target} + '' + )} + # EXAMPLE: Define 'firefox' action and bind to key. # program[firefox] = firefox http://spectrwm.org/ # bind[firefox] = MOD+Shift+b - + # QUIRKS # Default quirks, remove with: quirk[class:name] = NONE # IDEA-Quirks not working somehow... diff --git a/home/programs/ssh/default.nix b/home/programs/ssh/default.nix index 4ccc4e16..1c421a45 100644 --- a/home/programs/ssh/default.nix +++ b/home/programs/ssh/default.nix @@ -7,10 +7,12 @@ let cfg = config.custom.programs.ssh; sshDirectory = "${config.home.homeDirectory}/.ssh"; - mkHomeageFile = identity: nameValuePair identity { - source = "${config.custom.roles.homeage.secretsSourcePath}/${identity}.age"; - symlinks = [ "${sshDirectory}/${identity}" ]; - }; + mkHomeageFile = + identity: + nameValuePair identity { + source = "${config.custom.roles.homeage.secretsSourcePath}/${identity}.age"; + symlinks = [ "${sshDirectory}/${identity}" ]; + }; in diff --git a/home/roles/containers/default.nix b/home/roles/containers/default.nix index a8859bb5..054a0042 100644 --- a/home/roles/containers/default.nix +++ b/home/roles/containers/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/desktop/default.nix b/home/roles/desktop/default.nix index 9f0b2063..e8f385c3 100644 --- a/home/roles/desktop/default.nix +++ b/home/roles/desktop/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/desktop/gnome/default.nix b/home/roles/desktop/gnome/default.nix index b73630c3..5c90c59c 100644 --- a/home/roles/desktop/gnome/default.nix +++ b/home/roles/desktop/gnome/default.nix @@ -25,7 +25,16 @@ in "org/gnome/desktop/input-sources" = { show-all-sources = true; - sources = [ (mkTuple [ "xkb" "de+neo_qwertz" ]) (mkTuple [ "xkb" "de+bone" ]) ]; + sources = [ + (mkTuple [ + "xkb" + "de+neo_qwertz" + ]) + (mkTuple [ + "xkb" + "de+bone" + ]) + ]; }; "org/gnome/desktop/wm/keybindings" = { diff --git a/home/roles/desktop/gtk/default.nix b/home/roles/desktop/gtk/default.nix index d7accb6d..c91a52a9 100644 --- a/home/roles/desktop/gtk/default.nix +++ b/home/roles/desktop/gtk/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -50,9 +55,7 @@ in gtk-xft-hintstyle = "hintfull"; gtk-xft-rgba = "rgb"; }; - bookmarks = [ - "file://${config.home.homeDirectory}/Nextcloud" - ]; + bookmarks = [ "file://${config.home.homeDirectory}/Nextcloud" ]; }; }; }; diff --git a/home/roles/desktop/mobile/default.nix b/home/roles/desktop/mobile/default.nix index 155a3aec..6855fb0e 100644 --- a/home/roles/desktop/mobile/default.nix +++ b/home/roles/desktop/mobile/default.nix @@ -15,7 +15,5 @@ in }; }; - config = mkIf cfg.enable { - services.poweralertd.enable = true; - }; + config = mkIf cfg.enable { services.poweralertd.enable = true; }; } diff --git a/home/roles/desktop/password-manager/default.nix b/home/roles/desktop/password-manager/default.nix index dbe1babd..188625b6 100644 --- a/home/roles/desktop/password-manager/default.nix +++ b/home/roles/desktop/password-manager/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -28,8 +33,5 @@ in }; }; - config = mkIf cfg.enable - { - home.packages = [ cfg.package ]; - }; + config = mkIf cfg.enable { home.packages = [ cfg.package ]; }; } diff --git a/home/roles/desktop/terminal/default.nix b/home/roles/desktop/terminal/default.nix index 7c5edf78..1f1e6226 100644 --- a/home/roles/desktop/terminal/default.nix +++ b/home/roles/desktop/terminal/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -8,9 +13,10 @@ let cfg = desktopCfg.terminal; alacritty = - if config.custom.base.non-nixos.enable - then (hiPrio (config.lib.custom.nixGLWrap pkgs.alacritty)) - else pkgs.alacritty; + if config.custom.base.non-nixos.enable then + (hiPrio (config.lib.custom.nixGLWrap pkgs.alacritty)) + else + pkgs.alacritty; in @@ -39,82 +45,79 @@ in }; }; - config = mkIf cfg.enable - { - home = { - packages = with pkgs; [ - desktopCfg.font.package - ]; + config = mkIf cfg.enable { + home = { + packages = with pkgs; [ desktopCfg.font.package ]; - sessionVariables = { - TERMINAL = cfg.spawnCmd; - TERMCMD = cfg.spawnCmd; - }; + sessionVariables = { + TERMINAL = cfg.spawnCmd; + TERMCMD = cfg.spawnCmd; }; + }; - programs.alacritty = { - enable = true; - package = alacritty; - settings = { - env = { - TERM = "xterm-256color"; - WINIT_X11_SCALE_FACTOR = "1"; - }; - window = { - dynamic_padding = true; - opacity = 0.95; - }; - font = - let - fontFamily = "${desktopCfg.font.family}"; - in - { - normal = { - family = fontFamily; - style = "SemiBold"; - }; - bold = { - family = fontFamily; - style = "Bold"; - }; - italic = { - family = fontFamily; - style = "Italic"; - }; - bold_italic = { - family = fontFamily; - style = "Bold Italic"; - }; - size = 11.5; - }; - keyboard.bindings = [ - { - key = "Key0"; - mods = "Control"; - action = "ResetFontSize"; - } - { - key = "Numpad0"; - mods = "Control"; - action = "ResetFontSize"; - } - { - key = "NumpadAdd"; - mods = "Control"; - action = "IncreaseFontSize"; - } - { - key = "Plus"; - mods = "Control|Shift"; - action = "IncreaseFontSize"; - } - { - key = "NumpadSubtract"; - mods = "Control"; - action = "DecreaseFontSize"; - } - ]; + programs.alacritty = { + enable = true; + package = alacritty; + settings = { + env = { + TERM = "xterm-256color"; + WINIT_X11_SCALE_FACTOR = "1"; + }; + window = { + dynamic_padding = true; + opacity = 0.95; }; + font = + let + fontFamily = "${desktopCfg.font.family}"; + in + { + normal = { + family = fontFamily; + style = "SemiBold"; + }; + bold = { + family = fontFamily; + style = "Bold"; + }; + italic = { + family = fontFamily; + style = "Italic"; + }; + bold_italic = { + family = fontFamily; + style = "Bold Italic"; + }; + size = 11.5; + }; + keyboard.bindings = [ + { + key = "Key0"; + mods = "Control"; + action = "ResetFontSize"; + } + { + key = "Numpad0"; + mods = "Control"; + action = "ResetFontSize"; + } + { + key = "NumpadAdd"; + mods = "Control"; + action = "IncreaseFontSize"; + } + { + key = "Plus"; + mods = "Control|Shift"; + action = "IncreaseFontSize"; + } + { + key = "NumpadSubtract"; + mods = "Control"; + action = "DecreaseFontSize"; + } + ]; }; }; + }; } diff --git a/home/roles/desktop/wayland/default.nix b/home/roles/desktop/wayland/default.nix index 52c1d02e..259c3ccd 100644 --- a/home/roles/desktop/wayland/default.nix +++ b/home/roles/desktop/wayland/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -15,9 +20,5 @@ in }; }; - config = mkIf cfg.enable { - home.packages = with pkgs; [ - wl-clipboard - ]; - }; + config = mkIf cfg.enable { home.packages = with pkgs; [ wl-clipboard ]; }; } diff --git a/home/roles/desktop/wiki/default.nix b/home/roles/desktop/wiki/default.nix index 82e490e0..d896ec03 100644 --- a/home/roles/desktop/wiki/default.nix +++ b/home/roles/desktop/wiki/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -28,8 +33,5 @@ in }; }; - config = mkIf cfg.enable - { - custom.programs.logseq.enable = true; - }; + config = mkIf cfg.enable { custom.programs.logseq.enable = true; }; } diff --git a/home/roles/desktop/xserver/cursors/default.nix b/home/roles/desktop/xserver/cursors/default.nix index cdd3cddf..1d28eafb 100644 --- a/home/roles/desktop/xserver/cursors/default.nix +++ b/home/roles/desktop/xserver/cursors/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -17,9 +22,7 @@ in config = mkIf cfg.enable { home = { - packages = [ - pkgs.dconf - ]; + packages = [ pkgs.dconf ]; pointerCursor = { name = "volantes_cursors"; diff --git a/home/roles/desktop/xserver/default.nix b/home/roles/desktop/xserver/default.nix index 2f0b25e2..bab84738 100644 --- a/home/roles/desktop/xserver/default.nix +++ b/home/roles/desktop/xserver/default.nix @@ -1,4 +1,10 @@ -{ config, lib, inputs, pkgs, ... }: +{ + config, + lib, + inputs, + pkgs, + ... +}: with lib; @@ -101,7 +107,9 @@ in enable = true; initExtra = '' ${getBin pkgs.dbus}/bin/dbus-update-activation-environment --systemd --all - ${optionalString (!cfg.grobi.enable) "${getExe pkgs.feh} --no-fehbg --bg-fill --randomize ${inputs.wallpapers}"} + ${optionalString ( + !cfg.grobi.enable + ) "${getExe pkgs.feh} --no-fehbg --bg-fill --randomize ${inputs.wallpapers}"} ''; numlock.enable = true; }; diff --git a/home/roles/desktop/xserver/dmenu/default.nix b/home/roles/desktop/xserver/dmenu/default.nix index ad207f1f..6e876c81 100644 --- a/home/roles/desktop/xserver/dmenu/default.nix +++ b/home/roles/desktop/xserver/dmenu/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/desktop/xserver/dunst/default.nix b/home/roles/desktop/xserver/dunst/default.nix index aa6bcec8..d1f66808 100644 --- a/home/roles/desktop/xserver/dunst/default.nix +++ b/home/roles/desktop/xserver/dunst/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/desktop/xserver/grobi/default.nix b/home/roles/desktop/xserver/grobi/default.nix index e19a11f9..4510ee55 100644 --- a/home/roles/desktop/xserver/grobi/default.nix +++ b/home/roles/desktop/xserver/grobi/default.nix @@ -1,4 +1,10 @@ -{ config, lib, inputs, pkgs, ... }: +{ + config, + lib, + inputs, + pkgs, + ... +}: with lib; @@ -25,9 +31,7 @@ in rules = mkOption { type = with types; listOf attrs; - default = [ - fallbackRule - ]; + default = [ fallbackRule ]; description = "Grobi rules"; }; }; diff --git a/home/roles/desktop/xserver/locker/default.nix b/home/roles/desktop/xserver/locker/default.nix index 6afd7667..b01b7ada 100644 --- a/home/roles/desktop/xserver/locker/default.nix +++ b/home/roles/desktop/xserver/locker/default.nix @@ -1,4 +1,10 @@ -{ config, lib, inputs, pkgs, ... }: +{ + config, + lib, + inputs, + pkgs, + ... +}: with lib; @@ -28,11 +34,7 @@ in }; config = mkIf cfg.enable { - home.packages = [ - cfg.package - ] ++ (with pkgs; [ - playerctl - ]); + home.packages = [ cfg.package ] ++ (with pkgs; [ playerctl ]); services = { caffeine.enable = true; diff --git a/home/roles/desktop/xserver/picom/default.nix b/home/roles/desktop/xserver/picom/default.nix index b5f5d261..61ddd7dc 100644 --- a/home/roles/desktop/xserver/picom/default.nix +++ b/home/roles/desktop/xserver/picom/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -19,9 +24,10 @@ in services.picom = { enable = true; package = - if config.custom.base.non-nixos.enable - then (config.lib.custom.nixGLWrap pkgs.picom) - else pkgs.picom; + if config.custom.base.non-nixos.enable then + (config.lib.custom.nixGLWrap pkgs.picom) + else + pkgs.picom; backend = "glx"; settings = { blur = { diff --git a/home/roles/desktop/xserver/polybar/default.nix b/home/roles/desktop/xserver/polybar/default.nix index 35409775..8542ea9f 100644 --- a/home/roles/desktop/xserver/polybar/default.nix +++ b/home/roles/desktop/xserver/polybar/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -6,9 +11,7 @@ let cfg = config.custom.roles.desktop.xserver.polybar; - package = pkgs.polybar.override { - pulseSupport = true; - }; + package = pkgs.polybar.override { pulseSupport = true; }; in @@ -65,19 +68,35 @@ in monitors = { battery = mkEnableOption "Battery monitor"; - cpu = mkEnableOption "CPU monitor" // { default = true; }; - date = mkEnableOption "Date monitor" // { default = true; }; - disk = mkEnableOption "Disk monitor" // { default = true; }; - keyboard = mkEnableOption "Keyboard layout monitor" // { default = true; }; - memory = mkEnableOption "Memory monitor" // { default = true; }; - temperature = mkEnableOption "Temperature monitor" // { default = true; }; + cpu = mkEnableOption "CPU monitor" // { + default = true; + }; + date = mkEnableOption "Date monitor" // { + default = true; + }; + disk = mkEnableOption "Disk monitor" // { + default = true; + }; + keyboard = mkEnableOption "Keyboard layout monitor" // { + default = true; + }; + memory = mkEnableOption "Memory monitor" // { + default = true; + }; + temperature = mkEnableOption "Temperature monitor" // { + default = true; + }; temperature-source = mkOption { type = types.string; default = ""; description = "Temperature source path"; }; - volume = mkEnableOption "Volume monitor" // { default = true; }; - weather = mkEnableOption "Weather monitor" // { default = true; }; + volume = mkEnableOption "Volume monitor" // { + default = true; + }; + weather = mkEnableOption "Weather monitor" // { + default = true; + }; }; }; }; @@ -161,23 +180,25 @@ in # Modules module-margin = 1; - modules-left = with cfg.monitors; + modules-left = + with cfg.monitors; concatStringsSep " " ( - [ "xworkspaces" ] ++ - (if cpu then [ "cpu" ] else [ ]) ++ - (if memory then [ "ram" ] else [ ]) ++ - (if disk then [ "dsk" ] else [ ]) ++ - (if temperature then [ "tmp" ] else [ ]) + [ "xworkspaces" ] + ++ (if cpu then [ "cpu" ] else [ ]) + ++ (if memory then [ "ram" ] else [ ]) + ++ (if disk then [ "dsk" ] else [ ]) + ++ (if temperature then [ "tmp" ] else [ ]) ); modules-center = "xwindow"; - modules-right = with cfg.monitors; + modules-right = + with cfg.monitors; concatStringsSep " " ( - (if weather then [ "wtr" ] else [ ]) ++ - (if volume then [ "vol" ] else [ ]) ++ - (if battery then [ "bat" ] else [ ]) ++ - (if keyboard then [ "kbd" ] else [ ]) ++ - (if date then [ "date" ] else [ ]) ++ - [ "tray" ] + (if weather then [ "wtr" ] else [ ]) + ++ (if volume then [ "vol" ] else [ ]) + ++ (if battery then [ "bat" ] else [ ]) + ++ (if keyboard then [ "kbd" ] else [ ]) + ++ (if date then [ "date" ] else [ ]) + ++ [ "tray" ] ); }; @@ -422,7 +443,9 @@ in }; xdg = { - configFile."polybar/weather-plugin.sh".text = import ./config/weather-plugin.nix { inherit lib pkgs; }; + configFile."polybar/weather-plugin.sh".text = import ./config/weather-plugin.nix { + inherit lib pkgs; + }; }; }; } diff --git a/home/roles/desktop/xserver/xbindkeys/default.nix b/home/roles/desktop/xserver/xbindkeys/default.nix index 723d9351..cd0e5f18 100644 --- a/home/roles/desktop/xserver/xbindkeys/default.nix +++ b/home/roles/desktop/xserver/xbindkeys/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -26,14 +31,13 @@ let XF86HomePage = "xdg-open"; }; - mkRcEntry = keymap: + mkRcEntry = + keymap: concatStringsSep "\n" ( - mapAttrsToList - (code: command: '' - "${command}" - ${code} - '') - keymap + mapAttrsToList (code: command: '' + "${command}" + ${code} + '') keymap ); in diff --git a/home/roles/desktop/xserver/xmonad/default.nix b/home/roles/desktop/xserver/xmonad/default.nix index cdf7c0be..5fb72d78 100644 --- a/home/roles/desktop/xserver/xmonad/default.nix +++ b/home/roles/desktop/xserver/xmonad/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -18,7 +23,11 @@ in lightweight = mkEnableOption "Disable resource intensive effects"; modKey = mkOption { - type = types.enum [ "mod1" "mod2" "mod4" ]; + type = types.enum [ + "mod1" + "mod2" + "mod4" + ]; default = "mod4"; description = '' The window manager mod key. diff --git a/home/roles/desktop/xserver/xmonad/xmonad.hs.nix b/home/roles/desktop/xserver/xmonad/xmonad.hs.nix index 0d0b7aa7..d97e35c2 100644 --- a/home/roles/desktop/xserver/xmonad/xmonad.hs.nix +++ b/home/roles/desktop/xserver/xmonad/xmonad.hs.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, cfg, ... }: +{ + lib, + pkgs, + cfg, + ... +}: with lib; @@ -155,9 +160,11 @@ pkgs.writeText "xmonad.hs" '' myStartupHook :: X () myStartupHook = startupHook def <+> do - ${optionalString (cfg.autoruns != {}) '' - ${concatStringsSep "\n " (mapAttrsToList mkAutorun cfg.autoruns)} - ''} + ${ + optionalString (cfg.autoruns != { }) '' + ${concatStringsSep "\n " (mapAttrsToList mkAutorun cfg.autoruns)} + '' + } myLayout = avoidStruts $ smartBorders $ spacingWithEdge 5 $ tiled ||| Mirror tiled ||| Full where @@ -216,8 +223,7 @@ pkgs.writeText "xmonad.hs" '' , focusedBorderColor = "${cfg.colorScheme.base}" , layoutHook = myLayout -- Use custom layouts , manageHook = myManageHook -- Match on certain windows - ${optionalString (cfg.autoruns != {}) - ", startupHook = myStartupHook"} + ${optionalString (cfg.autoruns != { }) ", startupHook = myStartupHook"} } `additionalKeysP` myKeys diff --git a/home/roles/dev/default.nix b/home/roles/dev/default.nix index d80e3651..8073e829 100644 --- a/home/roles/dev/default.nix +++ b/home/roles/dev/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/dev/embedmongo/default.nix b/home/roles/dev/embedmongo/default.nix index c8e8f2f8..bc007cbe 100644 --- a/home/roles/dev/embedmongo/default.nix +++ b/home/roles/dev/embedmongo/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with builtins; with lib; @@ -13,7 +18,9 @@ let mkSymlink = dir: { name = ".embedmongo/extracted/${dir}/extractmongod"; - value = { source = "${mongodbPkg}/bin/mongod"; }; + value = { + source = "${mongodbPkg}/bin/mongod"; + }; }; in @@ -27,20 +34,16 @@ in config = mkIf cfg.enable { home = { - packages = [ - mongodbPkg - ]; - - file = genAttrs' - [ - "Linux-B64--2.0.3" - "Linux-B64--3.2.0" - "Linux-B64--3.6.2" - "Linux-B64--3.6.5" - "Linux-B64--4.0.2" - "Linux-B64--unknown---3.6.22" - ] - mkSymlink; + packages = [ mongodbPkg ]; + + file = genAttrs' [ + "Linux-B64--2.0.3" + "Linux-B64--3.2.0" + "Linux-B64--3.6.2" + "Linux-B64--3.6.5" + "Linux-B64--4.0.2" + "Linux-B64--unknown---3.6.22" + ] mkSymlink; }; }; } diff --git a/home/roles/dev/intellij/default.nix b/home/roles/dev/intellij/default.nix index 6d9f3fe5..76792576 100644 --- a/home/roles/dev/intellij/default.nix +++ b/home/roles/dev/intellij/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -7,7 +12,8 @@ let cfg = config.custom.roles.dev.intellij; ideaPackage = if cfg.ultimate then - pkgs.unstable.jetbrains.idea-ultimate else + pkgs.unstable.jetbrains.idea-ultimate + else pkgs.unstable.jetbrains.idea-community; in diff --git a/home/roles/dev/java/default.nix b/home/roles/dev/java/default.nix index b9847f82..d7dc638e 100644 --- a/home/roles/dev/java/default.nix +++ b/home/roles/dev/java/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/dev/js/default.nix b/home/roles/dev/js/default.nix index f819957e..98e848da 100644 --- a/home/roles/dev/js/default.nix +++ b/home/roles/dev/js/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/dev/plantuml/default.nix b/home/roles/dev/plantuml/default.nix index 90987134..65cdb58f 100644 --- a/home/roles/dev/plantuml/default.nix +++ b/home/roles/dev/plantuml/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/dev/scala/default.nix b/home/roles/dev/scala/default.nix index e6ded2e8..a21e1da4 100644 --- a/home/roles/dev/scala/default.nix +++ b/home/roles/dev/scala/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/gaming/commms/default.nix b/home/roles/gaming/commms/default.nix index 8294dfeb..2ca2c019 100644 --- a/home/roles/gaming/commms/default.nix +++ b/home/roles/gaming/commms/default.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: let diff --git a/home/roles/gaming/default.nix b/home/roles/gaming/default.nix index 36a36956..a3444296 100644 --- a/home/roles/gaming/default.nix +++ b/home/roles/gaming/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/gaming/mangohud/default.nix b/home/roles/gaming/mangohud/default.nix index ae0927f6..098a81eb 100644 --- a/home/roles/gaming/mangohud/default.nix +++ b/home/roles/gaming/mangohud/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -17,9 +22,7 @@ in config = mkIf cfg.enable { home = { - packages = with pkgs; [ - mangohud - ]; + packages = with pkgs; [ mangohud ]; }; xdg.configFile.MangoHud = { diff --git a/home/roles/gaming/minecraft/default.nix b/home/roles/gaming/minecraft/default.nix index 43122e4b..ac257fff 100644 --- a/home/roles/gaming/minecraft/default.nix +++ b/home/roles/gaming/minecraft/default.nix @@ -1,4 +1,9 @@ -{ lib, config, pkgs, ... }: +{ + lib, + config, + pkgs, + ... +}: let diff --git a/home/roles/gaming/retro/default.nix b/home/roles/gaming/retro/default.nix index f8d7a364..1c568302 100644 --- a/home/roles/gaming/retro/default.nix +++ b/home/roles/gaming/retro/default.nix @@ -13,7 +13,5 @@ in }; }; - config = lib.mkIf cfg.enable { - custom.programs.syncthing.enable = true; - }; + config = lib.mkIf cfg.enable { custom.programs.syncthing.enable = true; }; } diff --git a/home/roles/graphics/default.nix b/home/roles/graphics/default.nix index da3dacdf..d6c45bef 100644 --- a/home/roles/graphics/default.nix +++ b/home/roles/graphics/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -16,11 +21,6 @@ in }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - gimp - ] - ++ optionals pkgs.stdenv.isLinux [ - sxiv - ]; + home.packages = with pkgs; [ gimp ] ++ optionals pkgs.stdenv.isLinux [ sxiv ]; }; } diff --git a/home/roles/homeage/default.nix b/home/roles/homeage/default.nix index 8a6f9972..5f806ee3 100644 --- a/home/roles/homeage/default.nix +++ b/home/roles/homeage/default.nix @@ -1,4 +1,10 @@ -{ config, lib, pkgs, inputs, ... }: +{ + config, + lib, + pkgs, + inputs, + ... +}: with lib; @@ -6,10 +12,12 @@ let cfg = config.custom.roles.homeage; - mkHomeageFile = secret: nameValuePair secret { - source = "${cfg.secretsSourcePath}/${secret}.age"; - symlinks = [ "${cfg.secretsPath}/${secret}" ]; - }; + mkHomeageFile = + secret: + nameValuePair secret { + source = "${cfg.secretsSourcePath}/${secret}.age"; + symlinks = [ "${cfg.secretsPath}/${secret}" ]; + }; in diff --git a/home/roles/multimedia/converters/default.nix b/home/roles/multimedia/converters/default.nix index 634bf0af..75b075c8 100644 --- a/home/roles/multimedia/converters/default.nix +++ b/home/roles/multimedia/converters/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/multimedia/default.nix b/home/roles/multimedia/default.nix index 97c22ad3..ed88e339 100644 --- a/home/roles/multimedia/default.nix +++ b/home/roles/multimedia/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/multimedia/mpv/default.nix b/home/roles/multimedia/mpv/default.nix index 535ab33e..0a5a43b3 100644 --- a/home/roles/multimedia/mpv/default.nix +++ b/home/roles/multimedia/mpv/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -7,14 +12,16 @@ let cfg = config.custom.roles.multimedia.mpv; scripts = { - tv7 = pkgs.writeShellScriptBin "tv7" - '' - ${getExe pkgs.mpv} ${config.xdg.configFile."mpv/playlists".target}/TV7_default.m3u --script-opts=iptv=1 - ''; - tvsrg = pkgs.writeShellScriptBin "tvsrg" - '' - ${getExe pkgs.mpv} ${config.xdg.configFile."mpv/playlists".target}/srg-fhd-hls.m3u --script-opts=iptv=1 - ''; + tv7 = pkgs.writeShellScriptBin "tv7" '' + ${getExe pkgs.mpv} ${ + config.xdg.configFile."mpv/playlists".target + }/TV7_default.m3u --script-opts=iptv=1 + ''; + tvsrg = pkgs.writeShellScriptBin "tvsrg" '' + ${getExe pkgs.mpv} ${ + config.xdg.configFile."mpv/playlists".target + }/srg-fhd-hls.m3u --script-opts=iptv=1 + ''; }; in diff --git a/home/roles/office/cli/default.nix b/home/roles/office/cli/default.nix index 4c26bdad..4ea26ef5 100644 --- a/home/roles/office/cli/default.nix +++ b/home/roles/office/cli/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -66,22 +71,26 @@ in }; xdg.configFile = { - "khal/config".text = '' - [locale] - local_timezone = Europe/Zurich - default_timezone = Europe/Zurich - timeformat = %H:%M - dateformat = %d.%m. - longdateformat = %d.%m.%Y - datetimeformat = %d.%m. %H:%M - longdatetimeformat = %d.%m.%Y %H:%M + "khal/config".text = + '' + [locale] + local_timezone = Europe/Zurich + default_timezone = Europe/Zurich + timeformat = %H:%M + dateformat = %d.%m. + longdateformat = %d.%m.%Y + datetimeformat = %d.%m. %H:%M + longdatetimeformat = %d.%m.%Y %H:%M - '' + cfg.khal.extraConfig; - "vdirsyncer/config".text = '' - [general] - status_path = "${config.xdg.dataHome}/vdirsyncer/status/" + '' + + cfg.khal.extraConfig; + "vdirsyncer/config".text = + '' + [general] + status_path = "${config.xdg.dataHome}/vdirsyncer/status/" - '' + cfg.vdirsyncer.extraConfig; + '' + + cfg.vdirsyncer.extraConfig; }; }; } diff --git a/home/roles/office/default.nix b/home/roles/office/default.nix index 1f9ca174..3ae8cba1 100644 --- a/home/roles/office/default.nix +++ b/home/roles/office/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -16,12 +21,12 @@ in }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - reveal-md - ] - ++ optionals pkgs.stdenv.isLinux [ - libreoffice - openjdk - ]; + home.packages = + with pkgs; + [ reveal-md ] + ++ optionals pkgs.stdenv.isLinux [ + libreoffice + openjdk + ]; }; } diff --git a/home/roles/ops/default.nix b/home/roles/ops/default.nix index 081a38ad..3859000a 100644 --- a/home/roles/ops/default.nix +++ b/home/roles/ops/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -15,9 +20,5 @@ in }; }; - config = mkIf cfg.enable { - home.packages = [ - pkgs.lnav - ]; - }; + config = mkIf cfg.enable { home.packages = [ pkgs.lnav ]; }; } diff --git a/home/roles/web/default.nix b/home/roles/web/default.nix index c0be3992..78de5dc8 100644 --- a/home/roles/web/default.nix +++ b/home/roles/web/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/web/freetube/default.nix b/home/roles/web/freetube/default.nix index 3d5935ac..150f12aa 100644 --- a/home/roles/web/freetube/default.nix +++ b/home/roles/web/freetube/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -20,8 +25,6 @@ in programs.syncthing.enable = true; }; - home.packages = with pkgs; [ - freetube - ]; + home.packages = with pkgs; [ freetube ]; }; } diff --git a/home/roles/web/messengers/default.nix b/home/roles/web/messengers/default.nix index f26e7f5c..836cc1d5 100644 --- a/home/roles/web/messengers/default.nix +++ b/home/roles/web/messengers/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/roles/web/nextcloud-client/default.nix b/home/roles/web/nextcloud-client/default.nix index 795c7362..75d10fa8 100644 --- a/home/roles/web/nextcloud-client/default.nix +++ b/home/roles/web/nextcloud-client/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -6,9 +11,10 @@ let cfg = config.custom.roles.web.nextcloud-client; pkg = - if config.custom.base.non-nixos.enable - then (config.lib.custom.nixGLWrap pkgs.nextcloud-client) - else pkgs.nextcloud-client; + if config.custom.base.non-nixos.enable then + (config.lib.custom.nixGLWrap pkgs.nextcloud-client) + else + pkgs.nextcloud-client; in diff --git a/home/users/christian/fonts/default.nix b/home/users/christian/fonts/default.nix index eca15309..8c549f1c 100644 --- a/home/users/christian/fonts/default.nix +++ b/home/users/christian/fonts/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/users/christian/git/default.nix b/home/users/christian/git/default.nix index 66aab3d4..1d916640 100644 --- a/home/users/christian/git/default.nix +++ b/home/users/christian/git/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -7,9 +12,10 @@ let cfg = config.custom.users.christian.git; credentialHelper = - if pkgs.stdenv.isDarwin - then "${pkgs.gitFull}/share/git/contrib/credential/osxkeychain/git-credential-osxkeychain" - else "${pkgs.gitFull}/share/git/contrib/credential/libsecret/git-credential-libsecret"; + if pkgs.stdenv.isDarwin then + "${pkgs.gitFull}/share/git/contrib/credential/osxkeychain/git-credential-osxkeychain" + else + "${pkgs.gitFull}/share/git/contrib/credential/libsecret/git-credential-libsecret"; in @@ -23,9 +29,7 @@ in config = mkIf cfg.enable { custom.programs.lazygit.enable = true; - home.packages = with pkgs; [ - git-crypt - ]; + home.packages = with pkgs; [ git-crypt ]; programs.git = { enable = true; @@ -84,7 +88,6 @@ in # Global/OSX ".DS_Store" - # Community/Nix # @@ -95,7 +98,6 @@ in "result" "result-*" - # Global/Archives # @@ -132,7 +134,6 @@ in "*.msp" "*.txz" - # Global/Backup # @@ -142,20 +143,17 @@ in "*.orig" "*.tmp" - # Global/Diff # "*.patch" "*.diff" - # Global/Ansible # "*.retry" - # Global/Jetbrains # @@ -237,14 +235,12 @@ in # Android studio 3.1+ serialized cache file ".idea/caches/build_file_checksums.ser" - # Global/LibreOffice # # LibreOffice locks ".~lock.*#" - # Global/SBT # @@ -261,7 +257,6 @@ in ".cache" ".lib/" - # Global/Vagrant # @@ -271,7 +266,6 @@ in # Log files (if you are creating logs in debug mode, uncomment this) "*.log" - # Global/Vim # @@ -295,7 +289,6 @@ in # Persistent undo "[._]*.un~" - # Global/VisualStudioCode # diff --git a/home/users/christian/gpg/default.nix b/home/users/christian/gpg/default.nix index 300c0548..de96ef10 100644 --- a/home/users/christian/gpg/default.nix +++ b/home/users/christian/gpg/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/users/christian/mobile/default.nix b/home/users/christian/mobile/default.nix index 09956128..b13ea183 100644 --- a/home/users/christian/mobile/default.nix +++ b/home/users/christian/mobile/default.nix @@ -22,7 +22,10 @@ in custom = { programs.ssh = { enable = true; - identities = [ logseqSshKey logseqSshPubKey ]; + identities = [ + logseqSshKey + logseqSshPubKey + ]; }; }; diff --git a/home/users/christian/office/cli/default.nix b/home/users/christian/office/cli/default.nix index 678707f9..06cf8d32 100644 --- a/home/users/christian/office/cli/default.nix +++ b/home/users/christian/office/cli/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/users/christian/shell/aliases.nix b/home/users/christian/shell/aliases.nix index 2802313f..73a458ac 100644 --- a/home/users/christian/shell/aliases.nix +++ b/home/users/christian/shell/aliases.nix @@ -58,7 +58,8 @@ # Web wget = "wget -c"; myip = "curl http://ipecho.net/plain; echo"; -} // lib.optionalAttrs (!stdenv.isDarwin) { +} +// lib.optionalAttrs (!stdenv.isDarwin) { # Safety nets chgrp = "chgrp --preserve-root"; chmod = "chmod --preserve-root"; diff --git a/home/users/christian/shell/default.nix b/home/users/christian/shell/default.nix index 855f261a..552acfd4 100644 --- a/home/users/christian/shell/default.nix +++ b/home/users/christian/shell/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -69,7 +74,10 @@ in MANPAGER = "less -R --use-color -Dd+g -Du+b"; }; - shellAliases = import ./aliases.nix { inherit lib; inherit (pkgs) stdenv; }; + shellAliases = import ./aliases.nix { + inherit lib; + inherit (pkgs) stdenv; + }; }; programs = { diff --git a/home/users/christian/shell/direnv/default.nix b/home/users/christian/shell/direnv/default.nix index 83ceec64..960d481c 100644 --- a/home/users/christian/shell/direnv/default.nix +++ b/home/users/christian/shell/direnv/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/home/users/christian/ssh/default.nix b/home/users/christian/ssh/default.nix index 90063298..1537472d 100644 --- a/home/users/christian/ssh/default.nix +++ b/home/users/christian/ssh/default.nix @@ -15,7 +15,5 @@ in }; }; - config = mkIf cfg.enable { - custom.programs.ssh.enable = true; - }; + config = mkIf cfg.enable { custom.programs.ssh.enable = true; }; } diff --git a/home/users/christian/steam/default.nix b/home/users/christian/steam/default.nix index 2d4991a0..1121337c 100644 --- a/home/users/christian/steam/default.nix +++ b/home/users/christian/steam/default.nix @@ -6,13 +6,12 @@ let cfg = config.custom.users.christian.steam; - mkCfgs = filename: + mkCfgs = + filename: let csgoCfgPath = "Steam/steamapps/common/Counter-Strike Global Offensive/game/csgo/cfg"; in - nameValuePair "${csgoCfgPath}/${filename}.cfg" { - source = ./data/${filename}.cfg; - }; + nameValuePair "${csgoCfgPath}/${filename}.cfg" { source = ./data/${filename}.cfg; }; in @@ -24,15 +23,16 @@ in }; config = mkIf cfg.enable { - xdg.dataFile = listToAttrs (map mkCfgs [ - "autoexec" - "binds" - "crosshair" - "hud" - "input" - "myconf" - "net" - ] + xdg.dataFile = listToAttrs ( + map mkCfgs [ + "autoexec" + "binds" + "crosshair" + "hud" + "input" + "myconf" + "net" + ] ); }; } diff --git a/home/users/christian/vim/default.nix b/home/users/christian/vim/default.nix index 111d5d2f..56d8721d 100644 --- a/home/users/christian/vim/default.nix +++ b/home/users/christian/vim/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/hosts/macos/default.nix b/hosts/macos/default.nix index a06085a7..fe3ae194 100644 --- a/hosts/macos/default.nix +++ b/hosts/macos/default.nix @@ -12,8 +12,6 @@ autoUpdate = true; upgrade = true; }; - casks = [ - "alfred" - ]; + casks = [ "alfred" ]; }; } diff --git a/hosts/nix-on-droid/default.nix b/hosts/nix-on-droid/default.nix index 2c54454f..cfc2b8d9 100644 --- a/hosts/nix-on-droid/default.nix +++ b/hosts/nix-on-droid/default.nix @@ -1,3 +1 @@ -{ - system.stateVersion = import ./state-version.nix; -} +{ system.stateVersion = import ./state-version.nix; } diff --git a/hosts/nixos/default.nix b/hosts/nixos/default.nix index 3b7c5916..0f0ad660 100644 --- a/hosts/nixos/default.nix +++ b/hosts/nixos/default.nix @@ -2,7 +2,10 @@ imports = [ ./hardware ]; custom = { - base.users = [ "demo" "christian" ]; + base.users = [ + "demo" + "christian" + ]; roles = { android.enable = true; containers.enable = true; diff --git a/hosts/nixos/hardware/configuration.nix b/hosts/nixos/hardware/configuration.nix index ffd3a3cf..059a31ed 100644 --- a/hosts/nixos/hardware/configuration.nix +++ b/hosts/nixos/hardware/configuration.nix @@ -4,14 +4,16 @@ { lib, modulesPath, ... }: { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot = { initrd = { - availableKernelModules = [ "ata_piix" "ohci_pci" "sd_mod" "sr_mod" ]; + availableKernelModules = [ + "ata_piix" + "ohci_pci" + "sd_mod" + "sr_mod" + ]; kernelModules = [ "dm-snapshot" ]; luks.devices.root = { device = "/dev/sda2"; @@ -22,20 +24,17 @@ extraModulePackages = [ ]; }; - fileSystems."/" = - { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-label/boot"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; - swapDevices = - [{ device = "/dev/disk/by-label/swap"; }]; + swapDevices = [ { device = "/dev/disk/by-label/swap"; } ]; nix.settings.max-jobs = lib.mkDefault 2; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; diff --git a/lib/builders/mkApp.nix b/lib/builders/mkApp.nix index a4dd3480..73e9dd21 100644 --- a/lib/builders/mkApp.nix +++ b/lib/builders/mkApp.nix @@ -1,14 +1,17 @@ -{ inputs, pkgs, customLib, name, args, ... }: +{ + inputs, + pkgs, + customLib, + name, + args, + ... +}: let file = "${inputs.self}/lib/apps/${args.file}"; mkPath = args.path or (_: [ ]); - script = customLib.mkScript - name - file - (mkPath pkgs) - (args.envs or { }); + script = customLib.mkScript name file (mkPath pkgs) (args.envs or { }); in diff --git a/lib/builders/mkCheck.nix b/lib/builders/mkCheck.nix index dad4d9da..6e387449 100644 --- a/lib/builders/mkCheck.nix +++ b/lib/builders/mkCheck.nix @@ -1,4 +1,9 @@ -{ pkgs, name, args, ... }: +{ + pkgs, + name, + args, + ... +}: pkgs.runCommand name { } '' ${args.script pkgs} diff --git a/lib/builders/mkDevShell.nix b/lib/builders/mkDevShell.nix index d359d69c..c3b3e690 100644 --- a/lib/builders/mkDevShell.nix +++ b/lib/builders/mkDevShell.nix @@ -1,11 +1,17 @@ -{ pkgs, system, args, ... }: +{ + pkgs, + system, + args, + ... +}: let - preCommitShellHook = (import ./modules/pre-commit-checks { - inherit system pkgs; - inherit (args) flake; - }).shellHook; + preCommitShellHook = + (import ./modules/pre-commit-checks { + inherit system pkgs; + inherit (args) flake; + }).shellHook; in diff --git a/lib/builders/mkHome.nix b/lib/builders/mkHome.nix index d21aca80..bfd02e9e 100644 --- a/lib/builders/mkHome.nix +++ b/lib/builders/mkHome.nix @@ -1,4 +1,10 @@ -{ inputs, pkgs, homeModules, name, ... }: +{ + inputs, + pkgs, + homeModules, + name, + ... +}: let diff --git a/lib/builders/mkNixDarwin.nix b/lib/builders/mkNixDarwin.nix index dd2f4c5c..5c8a4f39 100644 --- a/lib/builders/mkNixDarwin.nix +++ b/lib/builders/mkNixDarwin.nix @@ -1,4 +1,12 @@ -{ inputs, system, pkgs, customLib, homeModules, name, ... }: +{ + inputs, + system, + pkgs, + customLib, + homeModules, + name, + ... +}: inputs.darwin.lib.darwinSystem { @@ -8,28 +16,28 @@ inputs.darwin.lib.darwinSystem { inherit homeModules inputs; }; - modules = [ - ./modules/nix + modules = + [ + ./modules/nix - # Host config - "${inputs.self}/hosts/${name}" + # Host config + "${inputs.self}/hosts/${name}" - { - custom.base.hostname = name; + { + custom.base.hostname = name; - lib.custom = customLib; + lib.custom = customLib; - nixpkgs = { - inherit pkgs; - }; - } + nixpkgs = { + inherit pkgs; + }; + } - # Home-Manager - inputs.home-manager.darwinModules.home-manager - ./modules/home-manager - ./modules/home-manager-users - ] - ++ customLib.getRecursiveDefaultNixFileList ../../nix-darwin - ++ customLib.getRecursiveDefaultNixFileList "${inputs.self}/nix-darwin"; + # Home-Manager + inputs.home-manager.darwinModules.home-manager + ./modules/home-manager + ./modules/home-manager-users + ] + ++ customLib.getRecursiveDefaultNixFileList ../../nix-darwin + ++ customLib.getRecursiveDefaultNixFileList "${inputs.self}/nix-darwin"; } - diff --git a/lib/builders/mkNixOnDroid.nix b/lib/builders/mkNixOnDroid.nix index 55949eed..bccc5151 100644 --- a/lib/builders/mkNixOnDroid.nix +++ b/lib/builders/mkNixOnDroid.nix @@ -1,4 +1,11 @@ -{ inputs, pkgs, customLib, homeModules, name, ... }: +{ + inputs, + pkgs, + customLib, + homeModules, + name, + ... +}: inputs.nix-on-droid.lib.nixOnDroidConfiguration { @@ -21,6 +28,5 @@ inputs.nix-on-droid.lib.nixOnDroidConfiguration { inherit pkgs; }; } - ] - ++ customLib.getRecursiveDefaultNixFileList ../../nix-on-droid; + ] ++ customLib.getRecursiveDefaultNixFileList ../../nix-on-droid; } diff --git a/lib/builders/mkNixos.nix b/lib/builders/mkNixos.nix index a93486ec..b609bea2 100644 --- a/lib/builders/mkNixos.nix +++ b/lib/builders/mkNixos.nix @@ -1,4 +1,12 @@ -{ inputs, system, pkgs, customLib, homeModules, name, ... }: +{ + inputs, + system, + pkgs, + customLib, + homeModules, + name, + ... +}: inputs.nixpkgs.lib.nixosSystem { @@ -8,28 +16,28 @@ inputs.nixpkgs.lib.nixosSystem { inherit homeModules inputs; }; - modules = [ - ./modules/nix + modules = + [ + ./modules/nix - # Host config - "${inputs.self}/hosts/${name}" + # Host config + "${inputs.self}/hosts/${name}" - { - custom.base.hostname = name; + { + custom.base.hostname = name; - lib.custom = customLib; + lib.custom = customLib; - nixpkgs = { - inherit pkgs; - }; - } + nixpkgs = { + inherit pkgs; + }; + } - # Home-Manager - inputs.home-manager.nixosModules.home-manager - ./modules/home-manager - ./modules/home-manager-users - ] - ++ customLib.getRecursiveDefaultNixFileList ../../nixos - ++ customLib.getRecursiveDefaultNixFileList "${inputs.self}/nixos"; + # Home-Manager + inputs.home-manager.nixosModules.home-manager + ./modules/home-manager + ./modules/home-manager-users + ] + ++ customLib.getRecursiveDefaultNixFileList ../../nixos + ++ customLib.getRecursiveDefaultNixFileList "${inputs.self}/nixos"; } - diff --git a/lib/builders/modules/home-manager-users/default.nix b/lib/builders/modules/home-manager-users/default.nix index b2e3ec9d..308f0f97 100644 --- a/lib/builders/modules/home-manager-users/default.nix +++ b/lib/builders/modules/home-manager-users/default.nix @@ -4,8 +4,7 @@ let baseCfg = config.custom.base; - importHmUser = u: - import (config.lib.custom.mkHostPath baseCfg.hostname "/home-${u}.nix"); + importHmUser = u: import (config.lib.custom.mkHostPath baseCfg.hostname "/home-${u}.nix"); hmUsers = lib.genAttrs baseCfg.users importHmUser; in diff --git a/lib/builders/modules/home-manager/default.nix b/lib/builders/modules/home-manager/default.nix index 7bb9664d..0dbdd96b 100644 --- a/lib/builders/modules/home-manager/default.nix +++ b/lib/builders/modules/home-manager/default.nix @@ -5,7 +5,9 @@ backupFileExtension = "hm-bak"; useGlobalPkgs = true; useUserPackages = true; - extraSpecialArgs = { inherit inputs; }; + extraSpecialArgs = { + inherit inputs; + }; sharedModules = homeModules; }; } diff --git a/lib/builders/modules/nix-commons/default.nix b/lib/builders/modules/nix-commons/default.nix index 624e2e2b..3d675784 100644 --- a/lib/builders/modules/nix-commons/default.nix +++ b/lib/builders/modules/nix-commons/default.nix @@ -1,4 +1,9 @@ -{ lib, inputs, pkgs, ... }: +{ + lib, + inputs, + pkgs, + ... +}: let @@ -15,7 +20,10 @@ in }; settings = { auto-optimise-store = lib.mkDefault true; - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = [ + "nix-command" + "flakes" + ]; log-lines = 30; } // nixSubstituters; }; diff --git a/lib/builders/modules/nix-home/default.nix b/lib/builders/modules/nix-home/default.nix index d35c9104..63d15312 100644 --- a/lib/builders/modules/nix-home/default.nix +++ b/lib/builders/modules/nix-home/default.nix @@ -1,4 +1,9 @@ -{ lib, inputs, pkgs, ... }: +{ + lib, + inputs, + pkgs, + ... +}: let diff --git a/lib/builders/modules/nix-nod/default.nix b/lib/builders/modules/nix-nod/default.nix index 17f18de1..ee692a6f 100644 --- a/lib/builders/modules/nix-nod/default.nix +++ b/lib/builders/modules/nix-nod/default.nix @@ -1,4 +1,4 @@ -{ lib, ... } @args: +{ lib, ... }@args: let diff --git a/lib/builders/modules/nix/default.nix b/lib/builders/modules/nix/default.nix index aba9c214..403e215a 100644 --- a/lib/builders/modules/nix/default.nix +++ b/lib/builders/modules/nix/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, config, ... } @args: +{ + lib, + pkgs, + config, + ... +}@args: let diff --git a/lib/builders/modules/pre-commit-checks/default.nix b/lib/builders/modules/pre-commit-checks/default.nix index e226912a..b031e3b5 100644 --- a/lib/builders/modules/pre-commit-checks/default.nix +++ b/lib/builders/modules/pre-commit-checks/default.nix @@ -1,4 +1,8 @@ -{ flake, system, pkgs }: +{ + flake, + system, + pkgs, +}: let diff --git a/lib/checks/default.nix b/lib/checks/default.nix index 5572aef0..3f601aeb 100644 --- a/lib/checks/default.nix +++ b/lib/checks/default.nix @@ -3,53 +3,41 @@ { # Nix - deadnix = pkgs.runCommand "check-deadnix" - { buildInputs = [ pkgs.deadnix ]; } - '' - mkdir $out - deadnix --fail ${flake} - ''; - - nixfmt = pkgs.runCommand "check-nixfmt" - { buildInputs = [ pkgs.nixfmt-rfc-style ]; } - '' - mkdir $out - nixfmt --check ${flake} - ''; - - statix = pkgs.runCommand "check-statix" - { buildInputs = [ pkgs.statix ]; } - '' - mkdir $out - statix check ${flake} - ''; + deadnix = pkgs.runCommand "check-deadnix" { buildInputs = [ pkgs.deadnix ]; } '' + mkdir $out + deadnix --fail ${flake} + ''; + + nixfmt = pkgs.runCommand "check-nixfmt" { buildInputs = [ pkgs.nixfmt-rfc-style ]; } '' + mkdir $out + nixfmt --check ${flake} + ''; + + statix = pkgs.runCommand "check-statix" { buildInputs = [ pkgs.statix ]; } '' + mkdir $out + statix check ${flake} + ''; # Shell - shellcheck = pkgs.runCommand "check-shellcheck" - { buildInputs = [ pkgs.shellcheck ]; } - '' - mkdir $out - cd ${flake} - IFS=$'\n' - for file in $(find . -name '*.sh' -type f); do shellcheck $file; done; - ''; + shellcheck = pkgs.runCommand "check-shellcheck" { buildInputs = [ pkgs.shellcheck ]; } '' + mkdir $out + cd ${flake} + IFS=$'\n' + for file in $(find . -name '*.sh' -type f); do shellcheck $file; done; + ''; # Misc - markdownlint = pkgs.runCommand "check-markdownlint" - { buildInputs = [ pkgs.markdownlint-cli ]; } - '' - mkdir $out - cd ${flake} - markdownlint . - ''; - - yamllint = pkgs.runCommand "check-yamllint" - { buildInputs = [ pkgs.yamllint ]; } - '' - mkdir $out - cd ${flake} - yamllint . - ''; + markdownlint = pkgs.runCommand "check-markdownlint" { buildInputs = [ pkgs.markdownlint-cli ]; } '' + mkdir $out + cd ${flake} + markdownlint . + ''; + + yamllint = pkgs.runCommand "check-yamllint" { buildInputs = [ pkgs.yamllint ]; } '' + mkdir $out + cd ${flake} + yamllint . + ''; } diff --git a/lib/customLib.nix b/lib/customLib.nix index a14aaa84..bb55cb6c 100644 --- a/lib/customLib.nix +++ b/lib/customLib.nix @@ -1,15 +1,18 @@ -{ lib, pkgs, inputs }: +{ + lib, + pkgs, + inputs, +}: -inputs.flake-commons.lib - { - inherit lib pkgs; - rootPath = inputs.self; - } // { +inputs.flake-commons.lib { + inherit lib pkgs; + rootPath = inputs.self; +} +// { # Wraps all binary files of the given `pkg` with `nixGL` - nixGLWrap = pkg: pkgs.runCommand - "${pkg.name}-nixgl-wrapped" - { meta.mainProgram = pkg.name; } - '' + nixGLWrap = + pkg: + pkgs.runCommand "${pkg.name}-nixgl-wrapped" { meta.mainProgram = pkg.name; } '' mkdir $out ln -s ${pkg}/* $out rm $out/bin @@ -23,10 +26,9 @@ inputs.flake-commons.lib ''; # Wraps the main program of the given `pkg` with `nixGL` and names the wrapper script as given `bin` - nixGLWrap' = pkg: bin: pkgs.runCommand - "${pkg.name}-nixgl-wrapped" - { meta.mainProgram = bin; } - '' + nixGLWrap' = + pkg: bin: + pkgs.runCommand "${pkg.name}-nixgl-wrapped" { meta.mainProgram = bin; } '' mkdir $out ln -s ${pkg}/* $out rm $out/bin diff --git a/lib/default.nix b/lib/default.nix index 26860ab0..a0bb5e94 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -7,12 +7,16 @@ let forEachSystem = lib.genAttrs (import inputs.systems); pkgsFor = forEachSystem (system: import ./nixpkgs.nix { inherit inputs system; }); - customLibFor = forEachSystem (system: import ./customLib.nix { - inherit lib inputs; - pkgs = pkgsFor."${system}"; - }); + customLibFor = forEachSystem ( + system: + import ./customLib.nix { + inherit lib inputs; + pkgs = pkgsFor."${system}"; + } + ); - homeModulesFor = forEachSystem (system: + homeModulesFor = forEachSystem ( + system: let customLib = customLibFor.${system}; in @@ -20,27 +24,35 @@ let inputs.homeage.homeManagerModules.homeage inputs.nix-index-database.hmModules.nix-index - { - lib.custom = customLib; - } + { lib.custom = customLib; } ] ++ customLib.getRecursiveDefaultNixFileList ../home ++ customLib.getRecursiveDefaultNixFileList "${inputs.self}/home" ); - nameValuePairWrapper = name: fn: system: lib.nameValuePair name (fn system); + nameValuePairWrapper = + name: fn: system: + lib.nameValuePair name (fn system); - wrapper = builder: name: args: system: - lib.nameValuePair - name - (import builder { - inherit inputs system name args; + wrapper = + builder: name: args: system: + lib.nameValuePair name ( + import builder { + inherit + inputs + system + name + args + ; pkgs = pkgsFor."${system}"; customLib = customLibFor."${system}"; homeModules = homeModulesFor."${system}"; - }); + } + ); - simpleWrapper = builder: system: name: wrapper builder name { } system; + simpleWrapper = + builder: system: name: + wrapper builder name { } system; buildersForSystem = system: builders: lib.listToAttrs (map (b: b system) builders); diff --git a/lib/nixpkgs.nix b/lib/nixpkgs.nix index 8b2fcbec..0876b4af 100644 --- a/lib/nixpkgs.nix +++ b/lib/nixpkgs.nix @@ -6,9 +6,7 @@ let allowAliases = false; allowUnfree = true; nvidia.acceptLicense = true; - permittedInsecurePackages = [ - "electron-27.3.11" - ]; + permittedInsecurePackages = [ "electron-27.3.11" ]; }; in @@ -18,9 +16,7 @@ import inputs.nixpkgs { overlays = let - unstable = import inputs.nixpkgs-unstable { - inherit config system; - }; + unstable = import inputs.nixpkgs-unstable { inherit config system; }; in [ (_final: _prev: { diff --git a/nix-darwin/nix/default.nix b/nix-darwin/nix/default.nix index d96f5f86..af69ea5a 100644 --- a/nix-darwin/nix/default.nix +++ b/nix-darwin/nix/default.nix @@ -1,3 +1 @@ -{ - nix.settings.auto-optimise-store = true; -} +{ nix.settings.auto-optimise-store = true; } diff --git a/nix-on-droid/default.nix b/nix-on-droid/default.nix index e8c3b36d..6d06e3b7 100644 --- a/nix-on-droid/default.nix +++ b/nix-on-droid/default.nix @@ -1,4 +1,10 @@ -{ lib, config, inputs, pkgs, ... }: +{ + lib, + config, + inputs, + pkgs, + ... +}: let @@ -50,9 +56,7 @@ with lib; terminal.font = let - fontPackage = pkgs.nerdfonts.override { - fonts = [ "VictorMono" ]; - }; + fontPackage = pkgs.nerdfonts.override { fonts = [ "VictorMono" ]; }; fontPath = "/share/fonts/truetype/NerdFonts/VictorMonoNerdFont-Regular.ttf"; in fontPackage + fontPath; diff --git a/nixos/base/agenix/default.nix b/nixos/base/agenix/default.nix index 2d84518d..765c33b0 100644 --- a/nixos/base/agenix/default.nix +++ b/nixos/base/agenix/default.nix @@ -1,4 +1,9 @@ -{ config, lib, inputs, ... }: +{ + config, + lib, + inputs, + ... +}: with lib; @@ -33,15 +38,11 @@ in config = { age = { - secrets = mkMerge (builtins.map - (secret: { - "${secret}".file = "${cfg.secretsBasePath}/${secret}.age"; - }) - cfg.secrets); - - identityPaths = [ - "/root/.age/key.txt" - ]; + secrets = mkMerge ( + builtins.map (secret: { "${secret}".file = "${cfg.secretsBasePath}/${secret}.age"; }) cfg.secrets + ); + + identityPaths = [ "/root/.age/key.txt" ]; }; }; } diff --git a/nixos/base/default.nix b/nixos/base/default.nix index 4ed09d40..cb13bb7a 100644 --- a/nixos/base/default.nix +++ b/nixos/base/default.nix @@ -1,11 +1,21 @@ -{ lib, config, pkgs, ... } @ args: +{ + lib, + config, + pkgs, + ... +}@args: let cfg = config.custom.base; - availableUsers = [ "christian" "demo" "gamer" ]; - importUserModule = u: + availableUsers = [ + "christian" + "demo" + "gamer" + ]; + importUserModule = + u: let isEnabled = builtins.any (x: x == u) cfg.users; userConfig = ./users + "/${u}.nix"; @@ -45,9 +55,7 @@ in zsh.enable = true; }; - security.sudo.package = pkgs.sudo.override { - withInsults = true; - }; + security.sudo.package = pkgs.sudo.override { withInsults = true; }; services.logind.extraConfig = '' HandlePowerKey=ignore diff --git a/nixos/base/system/default.nix b/nixos/base/system/default.nix index a62f7091..fc85199b 100644 --- a/nixos/base/system/default.nix +++ b/nixos/base/system/default.nix @@ -1,3 +1 @@ -{ - services.fwupd.enable = true; -} +{ services.fwupd.enable = true; } diff --git a/nixos/base/system/udiskie/default.nix b/nixos/base/system/udiskie/default.nix index c4279740..77701b4d 100644 --- a/nixos/base/system/udiskie/default.nix +++ b/nixos/base/system/udiskie/default.nix @@ -1,3 +1 @@ -{ - services.udisks2.enable = true; -} +{ services.udisks2.enable = true; } diff --git a/nixos/base/users/christian.nix b/nixos/base/users/christian.nix index 0402739c..1fabe38c 100644 --- a/nixos/base/users/christian.nix +++ b/nixos/base/users/christian.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -11,9 +16,7 @@ let in { - custom.base.agenix.secrets = [ - secretSmb - ]; + custom.base.agenix.secrets = [ secretSmb ]; fileSystems = let @@ -21,8 +24,20 @@ in fileserver = "sv-syno-01"; fsType = "cifs"; credentials = config.age.secrets."${secretSmb}".path; - automount_opts = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=60" "x-systemd.device-timeout=5s" "x-systemd.mount-timeout=5s" ]; - auth_opts = [ "uid=1000" "gid=100" "dir_mode=0700" "file_mode=0700" "credentials=${credentials}" ]; + automount_opts = [ + "x-systemd.automount" + "noauto" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=5s" + "x-systemd.mount-timeout=5s" + ]; + auth_opts = [ + "uid=1000" + "gid=100" + "dir_mode=0700" + "file_mode=0700" + "credentials=${credentials}" + ]; options = automount_opts ++ auth_opts; in { diff --git a/nixos/programs/adb/default.nix b/nixos/programs/adb/default.nix index f7027d19..295a46ea 100644 --- a/nixos/programs/adb/default.nix +++ b/nixos/programs/adb/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -17,12 +22,12 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - signify - ]; + environment.systemPackages = with pkgs; [ signify ]; programs.adb.enable = true; - users.users = genAttrs baseCfg.users (_: { extraGroups = [ "adbusers" ]; }); + users.users = genAttrs baseCfg.users (_: { + extraGroups = [ "adbusers" ]; + }); }; } diff --git a/nixos/roles/android/default.nix b/nixos/roles/android/default.nix index 1c1fe70c..c633fd47 100644 --- a/nixos/roles/android/default.nix +++ b/nixos/roles/android/default.nix @@ -15,7 +15,5 @@ in }; }; - config = mkIf cfg.enable { - custom.programs.adb.enable = true; - }; + config = mkIf cfg.enable { custom.programs.adb.enable = true; }; } diff --git a/nixos/roles/containers/default.nix b/nixos/roles/containers/default.nix index f0468820..8505d3cd 100644 --- a/nixos/roles/containers/default.nix +++ b/nixos/roles/containers/default.nix @@ -22,6 +22,8 @@ in enableOnBoot = false; }; - users.users = genAttrs baseCfg.users (_: { extraGroups = [ "docker" ]; }); + users.users = genAttrs baseCfg.users (_: { + extraGroups = [ "docker" ]; + }); }; } diff --git a/nixos/roles/desktop/mobile/default.nix b/nixos/roles/desktop/mobile/default.nix index a2d5a88d..78b1be98 100644 --- a/nixos/roles/desktop/mobile/default.nix +++ b/nixos/roles/desktop/mobile/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -38,29 +43,31 @@ in }; }; - networking.networkmanager.dispatcherScripts = [{ - source = pkgs.writeText "99-disable-wireless-when-wired" '' - myname=''${0##*/} - log() { logger -p user.info -t "''${myname}[$$]" "$*"; } - IFACE=$1 - ACTION=$2 + networking.networkmanager.dispatcherScripts = [ + { + source = pkgs.writeText "99-disable-wireless-when-wired" '' + myname=''${0##*/} + log() { logger -p user.info -t "''${myname}[$$]" "$*"; } + IFACE=$1 + ACTION=$2 - case ''${IFACE} in - eth*|usb*|en*) - case ''${ACTION} in - up) - log "disabling wifi radio" - rfkill block wifi - ;; - down) - log "enabling wifi radio" - rfkill unblock wifi - ;; - esac - ;; - esac - ''; - type = "basic"; - }]; + case ''${IFACE} in + eth*|usb*|en*) + case ''${ACTION} in + up) + log "disabling wifi radio" + rfkill block wifi + ;; + down) + log "enabling wifi radio" + rfkill unblock wifi + ;; + esac + ;; + esac + ''; + type = "basic"; + } + ]; }; } diff --git a/nixos/roles/gaming/default.nix b/nixos/roles/gaming/default.nix index 05279151..2da09678 100644 --- a/nixos/roles/gaming/default.nix +++ b/nixos/roles/gaming/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/nixos/roles/gaming/simracing/default.nix b/nixos/roles/gaming/simracing/default.nix index 72a5ef28..09f48cb8 100644 --- a/nixos/roles/gaming/simracing/default.nix +++ b/nixos/roles/gaming/simracing/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/nixos/roles/printing/default.nix b/nixos/roles/printing/default.nix index dae06804..3bf7ed42 100644 --- a/nixos/roles/printing/default.nix +++ b/nixos/roles/printing/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -22,22 +27,24 @@ in }; hardware = { - printers.ensurePrinters = [{ - name = "pr-hp-chr"; - location = "Home Office"; - description = "HP Officejet Pro 8600 Plus"; - deviceUri = "hp:/net/Officejet_Pro_8600?hostname=pr-hp-chr"; - model = "drv:///hp/hpcups.drv/hp-officejet_pro_8600.ppd"; - ppdOptions = { - "PageSize" = "A4"; - "Duplex" = "DuplexNoTumble"; - "InputSlot" = "Tray2"; - "ColorModel" = "KGray"; - "MediaType" = "Plain"; - "OutputMode" = "Normal"; - "OptionDuplex" = "True"; - }; - }]; + printers.ensurePrinters = [ + { + name = "pr-hp-chr"; + location = "Home Office"; + description = "HP Officejet Pro 8600 Plus"; + deviceUri = "hp:/net/Officejet_Pro_8600?hostname=pr-hp-chr"; + model = "drv:///hp/hpcups.drv/hp-officejet_pro_8600.ppd"; + ppdOptions = { + "PageSize" = "A4"; + "Duplex" = "DuplexNoTumble"; + "InputSlot" = "Tray2"; + "ColorModel" = "KGray"; + "MediaType" = "Plain"; + "OutputMode" = "Normal"; + "OptionDuplex" = "True"; + }; + } + ]; sane = { enable = true; diff --git a/nixos/roles/sound/default.nix b/nixos/roles/sound/default.nix index d6ff8240..1c33d0f2 100644 --- a/nixos/roles/sound/default.nix +++ b/nixos/roles/sound/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/nixos/roles/steambox/default.nix b/nixos/roles/steambox/default.nix index d5bd9c7a..8dd2361a 100644 --- a/nixos/roles/steambox/default.nix +++ b/nixos/roles/steambox/default.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; diff --git a/pkgs/hid-fanatecff/default.nix b/pkgs/hid-fanatecff/default.nix index c8a397cb..bd232f5a 100644 --- a/pkgs/hid-fanatecff/default.nix +++ b/pkgs/hid-fanatecff/default.nix @@ -1,11 +1,13 @@ -{ stdenv -, fetchFromGitHub -, kernel -, linuxConsoleTools -, runtimeShell +{ + stdenv, + fetchFromGitHub, + kernel, + linuxConsoleTools, + runtimeShell, }: -let moduledir = "lib/modules/${kernel.version}/kernel/drivers/hid"; +let + moduledir = "lib/modules/${kernel.version}/kernel/drivers/hid"; in stdenv.mkDerivation rec { pname = "hid-fanatecff"; @@ -19,7 +21,10 @@ stdenv.mkDerivation rec { hash = "sha256-FZc69a2joiCi8pPxeJxhORaqa/ABRecPqDhDCc2GwL0="; }; - hardeningDisable = [ "pic" "format" ]; + hardeningDisable = [ + "pic" + "format" + ]; nativeBuildInputs = kernel.moduleBuildDependencies; patchPhase = ''