From d331343012972f90f9681fca6b5402d07f2255c0 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Tue, 1 Mar 2022 22:19:03 +0100 Subject: [PATCH] Formatting with alejandra --- flake.nix | 205 ++++++------ home-manager/modules/alacritty/default.nix | 21 +- home-manager/modules/bat/default.nix | 12 +- home-manager/modules/dropbox/default.nix | 15 +- home-manager/modules/dunst/default.nix | 13 +- home-manager/modules/electron/default.nix | 13 +- home-manager/modules/emacs/default.nix | 15 +- home-manager/modules/firefox/default.nix | 36 +- home-manager/modules/fish/default.nix | 15 +- home-manager/modules/fish/functions.nix | 5 +- home-manager/modules/foot/default.nix | 13 +- home-manager/modules/git/default.nix | 14 +- home-manager/modules/gpg/default.nix | 12 +- home-manager/modules/neovim/default.nix | 17 +- home-manager/modules/obs-studio/default.nix | 15 +- home-manager/modules/rofi/default.nix | 14 +- home-manager/modules/solvespace/default.nix | 15 +- home-manager/modules/ssh/default.nix | 15 +- home-manager/modules/sway/default.nix | 75 ++--- home-manager/modules/tmux/default.nix | 12 +- home-manager/modules/vscode/default.nix | 109 ++++--- home-manager/modules/waybar/default.nix | 344 ++++++++++---------- home-manager/modules/zathura/default.nix | 17 +- krops.nix | 14 +- machines/drone/configuration.nix | 19 +- machines/drone/hardware-configuration.nix | 7 +- machines/loki/configuration.nix | 9 +- machines/loki/hardware-configuration.nix | 53 ++- machines/proxy/configuration.nix | 17 +- machines/proxy/hardware-configuration.nix | 7 +- machines/vm1/configuration.nix | 5 +- machines/vm1/hardware-configuration.nix | 45 ++- machines/vm2/configuration.nix | 5 +- machines/vm2/hardware-configuration.nix | 45 ++- modules/backscrub/default.nix | 17 +- modules/base/default.nix | 16 +- modules/bluetooth/default.nix | 13 +- modules/desktop/default.nix | 91 +++--- modules/docker/default.nix | 23 +- modules/drone/default.nix | 19 +- modules/element-web/default.nix | 17 +- modules/fonts/default.nix | 27 +- modules/gnome/default.nix | 12 +- modules/greetd/default.nix | 105 +++--- modules/livebook/default.nix | 13 +- modules/networking/default.nix | 50 +-- modules/nginx-proxy-manager/default.nix | 15 +- modules/nix-common/default.nix | 18 +- modules/options/default.nix | 14 +- modules/sound/default.nix | 24 +- modules/systemd/default.nix | 13 +- overlays/default.nix | 16 +- pkgs/backscrub/default.nix | 18 +- pkgs/lunarvim/default.nix | 63 ++-- pkgs/nix-plugins/default.nix | 16 +- pkgs/obs-backgroundremoval/default.nix | 18 +- pkgs/onnx-runtime/default.nix | 2 +- pkgs/rofi-wayland/default.nix | 90 ++--- users/erwin/default.nix | 7 +- users/root/default.nix | 3 +- 60 files changed, 1061 insertions(+), 907 deletions(-) diff --git a/flake.nix b/flake.nix index ccdd59b..579afa2 100644 --- a/flake.nix +++ b/flake.nix @@ -69,31 +69,37 @@ }; }; - outputs = { self, sops, ha-now-playing, pamedia, ... }@inputs: - with inputs; - let - + outputs = { + self, + sops, + ha-now-playing, + pamedia, + ... + } @ inputs: + with inputs; let defSystem = system: baseConfig: nixpkgs.lib.nixosSystem { system = "${system}"; modules = [ - { _module.args.inputs = inputs; } - { _module.args.self-overlay = self.overlay; } - ({ ... }: { - imports = builtins.attrValues self.nixosModules ++ [ - { - nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; - nixpkgs.overlays = [ - self.overlay - ha-now-playing.overlays.${system} - pamedia.overlays.${system} - ]; - } + {_module.args.inputs = inputs;} + {_module.args.self-overlay = self.overlay;} + ({...}: { + imports = + builtins.attrValues self.nixosModules + ++ [ + { + nix.nixPath = ["nixpkgs=${nixpkgs}"]; + nixpkgs.overlays = [ + self.overlay + ha-now-playing.overlays.${system} + pamedia.overlays.${system} + ]; + } - baseConfig - home-manager.nixosModules.home-manager - { home-manager.useUserPackages = true; } - ]; + baseConfig + home-manager.nixosModules.home-manager + {home-manager.useUserPackages = true;} + ]; system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; nix.registry.nixpkgs.flake = nixpkgs; @@ -107,23 +113,25 @@ pkgs = nixpkgs.legacyPackages.${system}; format = "lxc"; modules = [ - { _module.args.inputs = inputs; } - { _module.args.self-overlay = self.overlay; } - ({ ... }: { - imports = builtins.attrValues self.nixosModules ++ [ - { - nix.nixPath = [ "nixpkgs=${nixpkgs}" ]; - nixpkgs.overlays = [ - self.overlay - ha-now-playing.overlays.${system} - pamedia.overlays.${system} - ]; - } + {_module.args.inputs = inputs;} + {_module.args.self-overlay = self.overlay;} + ({...}: { + imports = + builtins.attrValues self.nixosModules + ++ [ + { + nix.nixPath = ["nixpkgs=${nixpkgs}"]; + nixpkgs.overlays = [ + self.overlay + ha-now-playing.overlays.${system} + pamedia.overlays.${system} + ]; + } - baseConfig - home-manager.nixosModules.home-manager - { home-manager.useUserPackages = true; } - ]; + baseConfig + home-manager.nixosModules.home-manager + {home-manager.useUserPackages = true;} + ]; system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; nix.registry.nixpkgs.flake = nixpkgs; @@ -131,72 +139,71 @@ sops.nixosModules.sops ]; }; - in - { - overlay = import ./overlays; - # overlay = final: prev: { - # unstable = import nixpkgs { - # system = "x86_64-linux"; - # config.allowUnfree = true; - # }; - # }; + { + overlay = import ./overlays; + # overlay = final: prev: { + # unstable = import nixpkgs { + # system = "x86_64-linux"; + # config.allowUnfree = true; + # }; + # }; - nixosModules = builtins.listToAttrs (map + nixosModules = builtins.listToAttrs (map (x: { name = x; value = import (./modules + "/${x}"); }) (builtins.attrNames (builtins.readDir ./modules))); - nixosConfigurations = { - vm1 = defSystem "x86_64-linux" { - imports = [ - (import (./machines/vm1/configuration.nix) { inherit self; }) - ]; - }; - vm2 = defSystem "x86_64-linux" { - imports = [ - (import (./machines/vm2/configuration.nix) { inherit self; }) - ]; + nixosConfigurations = { + vm1 = defSystem "x86_64-linux" { + imports = [ + (import ./machines/vm1/configuration.nix {inherit self;}) + ]; + }; + vm2 = defSystem "x86_64-linux" { + imports = [ + (import ./machines/vm2/configuration.nix {inherit self;}) + ]; + }; + + loki = defSystem "x86_64-linux" { + imports = [ + (import ./machines/loki/configuration.nix {inherit self;}) + ]; + }; + + drone = defSystem "x86_64-linux" { + imports = [ + (import ./machines/drone/configuration.nix {inherit self;}) + ]; + }; + + proxy = defSystem "x86_64-linux" { + imports = [ + (import ./machines/proxy/configuration.nix {inherit self;}) + ]; + }; }; - loki = defSystem "x86_64-linux" { - imports = [ - (import (./machines/loki/configuration.nix) { inherit self; }) - ]; - }; + nixosContainers = { + drone = defContainer "x86_64-linux" { + imports = [ + (import ./machines/drone/configuration.nix {inherit self;}) + ]; + }; - drone = defSystem "x86_64-linux" { - imports = [ - (import (./machines/drone/configuration.nix) { inherit self; }) - ]; + proxy = defContainer "x86_64-linux" { + imports = [ + (import ./machines/proxy/configuration.nix {inherit self;}) + ]; + }; }; - - proxy = defSystem "x86_64-linux" { - imports = [ - (import (./machines/proxy/configuration.nix) { inherit self; }) - ]; - }; - }; - - nixosContainers = { - drone = defContainer "x86_64-linux" { - imports = [ - (import (./machines/drone/configuration.nix) { inherit self; }) - ]; - }; - - proxy = defContainer "x86_64-linux" { - imports = [ - (import (./machines/proxy/configuration.nix) { inherit self; }) - ]; - }; - }; - } // - (flake-utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ]) - (system: - let + } + // (flake-utils.lib.eachSystem ["aarch64-linux" "x86_64-linux"]) + ( + system: let pkgs = import nixpkgs { inherit system; overlays = [ @@ -209,8 +216,7 @@ allowUnfree = true; }; }; - in - rec { + in rec { packages = flake-utils.lib.flattenTree { rofi-wayland = pkgs.rofi-wayland; nix-plugins = pkgs.nix-plugins; @@ -218,15 +224,16 @@ }; apps = { - rofi-wayland = flake-utils.lib.mkApp { drv = packages.rofi-wayland; }; - nix-plugins = flake-utils.lib.mkApp { drv = packages.nix-plugins; }; - backscrub = flake-utils.lib.mkApp { drv = packages.backscrub; }; + rofi-wayland = flake-utils.lib.mkApp {drv = packages.rofi-wayland;}; + nix-plugins = flake-utils.lib.mkApp {drv = packages.nix-plugins;}; + backscrub = flake-utils.lib.mkApp {drv = packages.backscrub;}; }; - devShell = with pkgs; mkShell { - nativeBuildInputs = [ sops ssh-to-pgp ]; - packages = [ sops ]; - }; + devShell = with pkgs; + mkShell { + nativeBuildInputs = [sops ssh-to-pgp]; + packages = [sops]; + }; } ); } diff --git a/home-manager/modules/alacritty/default.nix b/home-manager/modules/alacritty/default.nix index 16c7a38..cc286de 100644 --- a/home-manager/modules/alacritty/default.nix +++ b/home-manager/modules/alacritty/default.nix @@ -1,21 +1,25 @@ -{ lib, pkgs, config, ... }: -with lib; -let +{ + lib, + pkgs, + config, + ... +}: +with lib; let cfg = config.eboskma.programs.alacritty; - importYAML = name: yamlFile: (lib.importJSON ((pkgs.runCommandNoCC name { } '' + importYAML = name: yamlFile: (lib.importJSON ((pkgs.runCommandNoCC name {} '' mkdir -p $out ${pkgs.yaml2json}/bin/yaml2json < ${yamlFile} | ${pkgs.jq}/bin/jq -a '.' > $out/tmp.json - '').outPath + "/tmp.json")); + '') + .outPath + + "/tmp.json")); theme = importYAML "theme" (builtins.fetchurl { url = "https://raw.githubusercontent.com/dracula/alacritty/05faff15c0158712be87d200081633d9f4850a7d/dracula.yml"; sha256 = "1366rvvni2shbqlcrbypjv4f7p7ccdr6bvr685jnj8ipwqjjb6rn"; }); -in -{ +in { options.eboskma.programs.alacritty.enable = mkEnableOption "Enable alacritty"; config = mkIf cfg.enable { - programs.alacritty = { enable = true; settings = { @@ -99,7 +103,6 @@ in mouse = { hide_when_typing = true; }; - }; }; }; diff --git a/home-manager/modules/bat/default.nix b/home-manager/modules/bat/default.nix index 30d39b7..44a6ea9 100644 --- a/home-manager/modules/bat/default.nix +++ b/home-manager/modules/bat/default.nix @@ -1,8 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let cfg = config.eboskma.programs.bat; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.bat; +in { options.eboskma.programs.bat = { enable = mkEnableOption "enable bat"; }; diff --git a/home-manager/modules/dropbox/default.nix b/home-manager/modules/dropbox/default.nix index 6e69e56..55744f9 100644 --- a/home-manager/modules/dropbox/default.nix +++ b/home-manager/modules/dropbox/default.nix @@ -1,10 +1,13 @@ -{ lib, pkgs, config, ... }: -with lib; -let - cfg = config.eboskma.programs.dropbox; -in { - options.eboskma.programs.dropbox = { enable = mkEnableOption "activate dropbox"; }; + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.programs.dropbox; +in { + options.eboskma.programs.dropbox = {enable = mkEnableOption "activate dropbox";}; config = mkIf cfg.enable { services.dropbox.enable = true; diff --git a/home-manager/modules/dunst/default.nix b/home-manager/modules/dunst/default.nix index 1c6a661..33e7b04 100644 --- a/home-manager/modules/dunst/default.nix +++ b/home-manager/modules/dunst/default.nix @@ -1,9 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.programs.dunst; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.dunst; +in { options.eboskma.programs.dunst = { enable = mkEnableOption "activate dunst"; }; diff --git a/home-manager/modules/electron/default.nix b/home-manager/modules/electron/default.nix index 3898c17..da88b92 100644 --- a/home-manager/modules/electron/default.nix +++ b/home-manager/modules/electron/default.nix @@ -1,9 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.programs.electron; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.electron; +in { options.eboskma.programs.electron = { enable = mkEnableOption "activate electron settings"; wayland = mkEnableOption "set Wayland compatibility settings"; diff --git a/home-manager/modules/emacs/default.nix b/home-manager/modules/emacs/default.nix index a09a404..940a83a 100644 --- a/home-manager/modules/emacs/default.nix +++ b/home-manager/modules/emacs/default.nix @@ -1,10 +1,13 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.programs.emacs; -in { - options.eboskma.programs.emacs = { enable = mkEnableOption "activate emacs"; }; + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.emacs; +in { + options.eboskma.programs.emacs = {enable = mkEnableOption "activate emacs";}; # imports = [ inputs.nix-doom-emacs.hmModule ]; diff --git a/home-manager/modules/firefox/default.nix b/home-manager/modules/firefox/default.nix index dda07de..cb7dbaa 100644 --- a/home-manager/modules/firefox/default.nix +++ b/home-manager/modules/firefox/default.nix @@ -1,7 +1,10 @@ -{ pkgs, config, lib, ... }: -with lib; - -let +{ + pkgs, + config, + lib, + ... +}: +with lib; let cfg = config.eboskma.programs.firefox; profileSettings = { @@ -19,9 +22,23 @@ let }; nonDefaultDesktop = pkgs.makeDesktopItem { - name = "firefox-" + (if cfg.work then "private" else "horus"); - desktopName = "Firefox (" + (if cfg.work then "Private" else "Horus") + ")"; - exec = "firefox -P " + (if cfg.work then "private" else "horus") + " %u"; + name = + "firefox-" + + (if cfg.work + then "private" + else "horus"); + desktopName = + "Firefox (" + + (if cfg.work + then "Private" + else "Horus") + + ")"; + exec = + "firefox -P " + + (if cfg.work + then "private" + else "horus") + + " %u"; icon = "firefox"; categories = "GNOME;GTK;Network;WebBrowser"; mimeType = "text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;"; @@ -30,8 +47,7 @@ let "X-MultipleArgs" = "false"; }; }; -in -{ +in { options.eboskma.programs.firefox = { enable = mkEnableOption "enable firefox"; work = mkOption { @@ -61,6 +77,6 @@ in }; }; - home.packages = [ nonDefaultDesktop ]; + home.packages = [nonDefaultDesktop]; }; } diff --git a/home-manager/modules/fish/default.nix b/home-manager/modules/fish/default.nix index 61ea9cb..46f5f09 100644 --- a/home-manager/modules/fish/default.nix +++ b/home-manager/modules/fish/default.nix @@ -1,9 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; - -let cfg = config.eboskma.programs.fish; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.fish; +in { options.eboskma.programs.fish = { enable = mkEnableOption "Enable fish shell"; }; @@ -11,7 +14,7 @@ in config = mkIf (cfg.enable) { programs.fish = { enable = true; - functions = (import ./functions.nix { inherit (pkgs) git; }); + functions = import ./functions.nix {inherit (pkgs) git;}; plugins = [ { diff --git a/home-manager/modules/fish/functions.nix b/home-manager/modules/fish/functions.nix index 7a8af37..bb1b08f 100644 --- a/home-manager/modules/fish/functions.nix +++ b/home-manager/modules/fish/functions.nix @@ -1,5 +1,4 @@ -{ git }: -{ +{git}: { reload = { body = '' history --save @@ -28,7 +27,7 @@ for f in $files set file (realpath $repo_path/$f) echo "Processing $file" - + set ext (string match -r ".*\.([^\.]+)\$" $file)[2] if contains $ext $source_exts diff --git a/home-manager/modules/foot/default.nix b/home-manager/modules/foot/default.nix index cab9d99..3d16239 100644 --- a/home-manager/modules/foot/default.nix +++ b/home-manager/modules/foot/default.nix @@ -1,9 +1,12 @@ -{ lib, pkgs, config, ... }: -with lib; -let - cfg = config.eboskma.programs.foot; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.programs.foot; +in { options.eboskma.programs.foot = { enable = mkEnableOption "activate foot"; server = mkEnableOption "enable foot server"; diff --git a/home-manager/modules/git/default.nix b/home-manager/modules/git/default.nix index 1ff94b6..b8527fd 100644 --- a/home-manager/modules/git/default.nix +++ b/home-manager/modules/git/default.nix @@ -1,8 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let cfg = config.eboskma.programs.git; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.git; +in { options.eboskma.programs.git = { enable = mkEnableOption "enable git"; @@ -59,7 +63,7 @@ in }; extraConfig = { - credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret"; + credential.helper = "${pkgs.git.override {withLibsecret = true;}}/bin/git-credential-libsecret"; init = { defaultBranch = "main"; }; diff --git a/home-manager/modules/gpg/default.nix b/home-manager/modules/gpg/default.nix index 610d0d0..11f715b 100644 --- a/home-manager/modules/gpg/default.nix +++ b/home-manager/modules/gpg/default.nix @@ -1,8 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let cfg = config.eboskma.programs.gpg; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.gpg; +in { options.eboskma.programs.gpg = { enable = mkEnableOption "enable gpg"; }; diff --git a/home-manager/modules/neovim/default.nix b/home-manager/modules/neovim/default.nix index accf2f6..12a4ad1 100644 --- a/home-manager/modules/neovim/default.nix +++ b/home-manager/modules/neovim/default.nix @@ -1,10 +1,13 @@ -{ lib, pkgs, config, ... }: -with lib; -let - cfg = config.eboskma.programs.neovim; -in { - options.eboskma.programs.neovim = { enable = mkEnableOption "activate neovim"; }; + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.programs.neovim; +in { + options.eboskma.programs.neovim = {enable = mkEnableOption "activate neovim";}; config = mkIf cfg.enable { # unfortunately this does properly support a Lua based config @@ -25,7 +28,7 @@ in # ''; # }; - home.packages = with pkgs; [ neovim ]; + home.packages = with pkgs; [neovim]; xdg.configFile.nvim = { source = ./config; diff --git a/home-manager/modules/obs-studio/default.nix b/home-manager/modules/obs-studio/default.nix index 5ad9561..54b1d52 100644 --- a/home-manager/modules/obs-studio/default.nix +++ b/home-manager/modules/obs-studio/default.nix @@ -1,10 +1,13 @@ -{ lib, pkgs, config, ... }: -with lib; -let - cfg = config.eboskma.programs.obs-studio; -in { - options.eboskma.programs.obs-studio = { enable = mkEnableOption "activate obs-studio"; }; + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.programs.obs-studio; +in { + options.eboskma.programs.obs-studio = {enable = mkEnableOption "activate obs-studio";}; config = mkIf cfg.enable { programs.obs-studio = { diff --git a/home-manager/modules/rofi/default.nix b/home-manager/modules/rofi/default.nix index 71c427d..15f10db 100644 --- a/home-manager/modules/rofi/default.nix +++ b/home-manager/modules/rofi/default.nix @@ -1,13 +1,15 @@ -{ lib, pkgs, config, ... }: -with lib; -let - cfg = config.eboskma.programs.rofi; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.programs.rofi; +in { options.eboskma.programs.rofi.enable = mkEnableOption "Enable rofi"; config = mkIf cfg.enable { - programs.rofi = { enable = true; package = pkgs.rofi-wayland; diff --git a/home-manager/modules/solvespace/default.nix b/home-manager/modules/solvespace/default.nix index ef1396f..5cbdce6 100644 --- a/home-manager/modules/solvespace/default.nix +++ b/home-manager/modules/solvespace/default.nix @@ -1,10 +1,13 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.programs.solvespace; -in { - options.eboskma.programs.solvespace = { enable = mkEnableOption "activate solvespace"; }; + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.solvespace; +in { + options.eboskma.programs.solvespace = {enable = mkEnableOption "activate solvespace";}; config = mkIf (cfg.enable) { home.packages = with pkgs; [ diff --git a/home-manager/modules/ssh/default.nix b/home-manager/modules/ssh/default.nix index f25d403..71f99f0 100644 --- a/home-manager/modules/ssh/default.nix +++ b/home-manager/modules/ssh/default.nix @@ -1,10 +1,13 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.programs.ssh; -in { - options.eboskma.programs.ssh = { enable = mkEnableOption "activate ssh"; }; + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.ssh; +in { + options.eboskma.programs.ssh = {enable = mkEnableOption "activate ssh";}; config = mkIf (cfg.enable) { programs.ssh = { diff --git a/home-manager/modules/sway/default.nix b/home-manager/modules/sway/default.nix index e95646b..091b6c5 100644 --- a/home-manager/modules/sway/default.nix +++ b/home-manager/modules/sway/default.nix @@ -1,13 +1,16 @@ -{ lib, pkgs, config, ... }: -with lib; -let +{ + lib, + pkgs, + config, + ... +}: +with lib; let cfg = config.eboskma.programs.sway; mod = "Mod4"; swaylockcmd = "${pkgs.swaylock-effects}/bin/swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --clock --image ~/.wallpapers/river-2560.png --fade-in 0.5 --scaling fill"; # swaylockcmd = "${pkgs.swaylock}/bin/swaylock --ignore-empty-password --daemonize --show-failed-attempts --indicator-caps-lock --image ~/.wallpapers/river-2560.png --scaling fill"; rofiPower = pkgs.writeShellScriptBin "rofi-power" (builtins.readFile ./powermenu.sh); -in -{ +in { options.eboskma.programs.sway.enable = mkEnableOption "Enable sway"; config = mkIf cfg.enable { @@ -17,10 +20,10 @@ in modifier = mod; assigns = { - "1" = [{ app_id = "firefox"; }]; - "2" = [{ app_id = "Alacritty"; } { app_id = "foot"; }]; - "3" = [{ class = "Code"; }]; - "10" = [{ class = "telegramdesktop"; } { app_id = "Signal"; }]; + "1" = [{app_id = "firefox";}]; + "2" = [{app_id = "Alacritty";} {app_id = "foot";}]; + "3" = [{class = "Code";}]; + "10" = [{class = "telegramdesktop";} {app_id = "Signal";}]; }; bars = [ { @@ -76,12 +79,12 @@ in right = "o"; floating = { - criteria = [{ app_id = "gnome-calculator"; }]; + criteria = [{app_id = "gnome-calculator";}]; modifier = mod; }; fonts = { - names = [ "Iosevka Nerd Font" ]; + names = ["Iosevka Nerd Font"]; style = "Regular"; size = 12.0; }; @@ -166,26 +169,16 @@ in "${mod}+9" = "workspace number 9"; "${mod}+0" = "workspace number 10"; - "${mod}+Shift+1" = - "move container to workspace number 1"; - "${mod}+Shift+2" = - "move container to workspace number 2"; - "${mod}+Shift+3" = - "move container to workspace number 3"; - "${mod}+Shift+4" = - "move container to workspace number 4"; - "${mod}+Shift+5" = - "move container to workspace number 5"; - "${mod}+Shift+6" = - "move container to workspace number 6"; - "${mod}+Shift+7" = - "move container to workspace number 7"; - "${mod}+Shift+8" = - "move container to workspace number 8"; - "${mod}+Shift+9" = - "move container to workspace number 9"; - "${mod}+Shift+0" = - "move container to workspace number 10"; + "${mod}+Shift+1" = "move container to workspace number 1"; + "${mod}+Shift+2" = "move container to workspace number 2"; + "${mod}+Shift+3" = "move container to workspace number 3"; + "${mod}+Shift+4" = "move container to workspace number 4"; + "${mod}+Shift+5" = "move container to workspace number 5"; + "${mod}+Shift+6" = "move container to workspace number 6"; + "${mod}+Shift+7" = "move container to workspace number 7"; + "${mod}+Shift+8" = "move container to workspace number 8"; + "${mod}+Shift+9" = "move container to workspace number 9"; + "${mod}+Shift+0" = "move container to workspace number 10"; "${mod}+Shift+minus" = "move scratchpad"; "${mod}+minus" = "scratchpad show"; @@ -222,7 +215,6 @@ in hide_cursor = "when-typing enable"; }; }; - }; extraConfig = '' assign [app_id="firefox"] 1 @@ -237,7 +229,7 @@ in for_window [shell="xwayland"] title_format "%title [XWayland]" exec --no-startup-id ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator - + include /etc/sway/config.d/* ''; @@ -282,11 +274,20 @@ in swayidle = { enable = true; events = [ - { event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; } + { + event = "after-resume"; + command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; + } ]; timeouts = [ - { timeout = 900; command = swaylockcmd; } - { timeout = 1200; command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'"; } + { + timeout = 900; + command = swaylockcmd; + } + { + timeout = 1200; + command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'"; + } ]; }; }; @@ -294,7 +295,7 @@ in systemd.user.targets.tray = { Unit = { Description = "Home Manager System Tray"; - Requires = [ "graphical-session-pre.target" ]; + Requires = ["graphical-session-pre.target"]; }; }; }; diff --git a/home-manager/modules/tmux/default.nix b/home-manager/modules/tmux/default.nix index f53249c..44c49ac 100644 --- a/home-manager/modules/tmux/default.nix +++ b/home-manager/modules/tmux/default.nix @@ -1,8 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let cfg = config.eboskma.programs.tmux; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.tmux; +in { options.eboskma.programs.tmux = { enable = mkEnableOption "enable tmux"; }; diff --git a/home-manager/modules/vscode/default.nix b/home-manager/modules/vscode/default.nix index e781d0c..ec6710b 100644 --- a/home-manager/modules/vscode/default.nix +++ b/home-manager/modules/vscode/default.nix @@ -1,62 +1,65 @@ -{ lib, pkgs, config, flake-inputs, ... }: -with lib; -let cfg = config.eboskma.programs.vscode; -in { + lib, + pkgs, + config, + flake-inputs, + ... +}: +with lib; let + cfg = config.eboskma.programs.vscode; +in { options.eboskma.programs.vscode.enable = mkEnableOption "enable vscode"; config = mkIf cfg.enable { - programs.vscode = { enable = true; package = pkgs.vscode; - extensions = - (with pkgs.vscode-extensions; [ - arrterian.nix-env-selector - bbenoist.nix - # brettm12345.nixfmt-vscode - # aaronduino.nix-lsp - # aliariff.auto-add-brackets - bradlc.vscode-tailwindcss - # bungcip.better-toml - coolbear.systemd-unit-file - # dawhite.mustache - dbaeumer.vscode-eslint - denoland.vscode-deno - # dlasagno.rasi - # dprint.dprint - editorconfig.editorconfig - esbenp.prettier-vscode - # EugenWiens.bitbake - elixir-lsp.vscode-elixir-ls # this is the one by Jake Becker, not the deprecated one - # kumar-harsh.graphql-for-vscode - matklad.rust-analyzer - # monokai.theme-monokai-pro-vscode - ms-azuretools.vscode-docker - ms-python.python - ms-python.vscode-pylance - ms-toolsai.jupyter - # ms-toolsai.jupyter-keymap - # ms-toolsai.jupyter-renderers - # ms-vscode-remote.remote-containers - ms-vscode-remote.remote-ssh - # ms-vscode-remote.remote-ssh-edit - # ms-vscode.cmake-tools - ms-vscode.cpptools - # msaraiva.surface - # pgourlain.erlang - # phoenixframework.phoenix - rubymaniac.vscode-paste-and-indent - # surajbarkale.ninja - timonwong.shellcheck - # twxs.cmake - vadimcn.vscode-lldb - # vscode-icons-team.vscode-icons - vscodevim.vim - wholroyd.jinja - xaver.clang-format - zxh404.vscode-proto3 - ]); + extensions = with pkgs.vscode-extensions; [ + arrterian.nix-env-selector + bbenoist.nix + # brettm12345.nixfmt-vscode + # aaronduino.nix-lsp + # aliariff.auto-add-brackets + bradlc.vscode-tailwindcss + # bungcip.better-toml + coolbear.systemd-unit-file + # dawhite.mustache + dbaeumer.vscode-eslint + denoland.vscode-deno + # dlasagno.rasi + # dprint.dprint + editorconfig.editorconfig + esbenp.prettier-vscode + # EugenWiens.bitbake + elixir-lsp.vscode-elixir-ls # this is the one by Jake Becker, not the deprecated one + # kumar-harsh.graphql-for-vscode + matklad.rust-analyzer + # monokai.theme-monokai-pro-vscode + ms-azuretools.vscode-docker + ms-python.python + ms-python.vscode-pylance + ms-toolsai.jupyter + # ms-toolsai.jupyter-keymap + # ms-toolsai.jupyter-renderers + # ms-vscode-remote.remote-containers + ms-vscode-remote.remote-ssh + # ms-vscode-remote.remote-ssh-edit + # ms-vscode.cmake-tools + ms-vscode.cpptools + # msaraiva.surface + # pgourlain.erlang + # phoenixframework.phoenix + rubymaniac.vscode-paste-and-indent + # surajbarkale.ninja + timonwong.shellcheck + # twxs.cmake + vadimcn.vscode-lldb + # vscode-icons-team.vscode-icons + vscodevim.vim + wholroyd.jinja + xaver.clang-format + zxh404.vscode-proto3 + ]; keybindings = [ { @@ -73,7 +76,7 @@ in } ]; - userSettings = (builtins.fromJSON (builtins.readFile ./settings.json)); + userSettings = builtins.fromJSON (builtins.readFile ./settings.json); }; home.packages = with pkgs; [ diff --git a/home-manager/modules/waybar/default.nix b/home-manager/modules/waybar/default.nix index 2912ae9..9c3b036 100644 --- a/home-manager/modules/waybar/default.nix +++ b/home-manager/modules/waybar/default.nix @@ -1,9 +1,12 @@ -{ lib, pkgs, config, ... }: -with lib; -let - cfg = config.eboskma.programs.waybar; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.programs.waybar; +in { options.eboskma.programs.waybar.enable = mkEnableOption "Enable waybar"; config = mkIf cfg.enable { @@ -137,7 +140,7 @@ in phone = ""; portable = ""; car = ""; - default = [ "奄" "奔" "墳" ]; + default = ["奄" "奔" "墳"]; }; on-click = "pavucontrol"; }; @@ -169,199 +172,196 @@ in }; }; }; - } - ]; - style = - '' - @keyframes blink-warning { - 70% { - color: white; - } - - to { - color: white; - background-color: orange; - } - } - - @keyframes blink-critical { - 70% { + style = '' + @keyframes blink-warning { + 70% { color: white; - } + } - to { - color: white; - background-color: red; - } - } + to { + color: white; + background-color: orange; + } + } - * { - border: none; - border-radius: 0; - min-height: 0; - margin: 0; - padding: 0; - } - - #waybar { - background: #323232; + @keyframes blink-critical { + 70% { color: white; - font-family: "MesloLGM Nerd Font", sans-serif; - font-size: 13px; - } + } - #battery, - #clock, - #cpu, - #custom-keyboard-layout, - #memory, - #mode, - #network, - #pulseaudio, - #temperature, - #tray, - #custom-now_playing, - #idle_inhibitor { - padding-left: 10px; - padding-right: 10px; - } + to { + color: white; + background-color: red; + } + } - #battery { - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } + * { + border: none; + border-radius: 0; + min-height: 0; + margin: 0; + padding: 0; + } - #battery.warning { - color: orange; - } + #waybar { + background: #323232; + color: white; + font-family: "MesloLGM Nerd Font", sans-serif; + font-size: 13px; + } - #battery.critical { - color: red; - } + #battery, + #clock, + #cpu, + #custom-keyboard-layout, + #memory, + #mode, + #network, + #pulseaudio, + #temperature, + #tray, + #custom-now_playing, + #idle_inhibitor { + padding-left: 10px; + padding-right: 10px; + } - #battery.warning.discharging { - animation-name: blink-warning; - animation-duration: 3s; - } + #battery { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } - #battery.critical.discharging { - animation-name: blink-critical; - animation-duration: 2s; - } + #battery.warning { + color: orange; + } - #clock { - font-weight: bold; - } + #battery.critical { + color: red; + } - #cpu { + #battery.warning.discharging { + animation-name: blink-warning; + animation-duration: 3s; + } + + #battery.critical.discharging { + animation-name: blink-critical; + animation-duration: 2s; + } + + #clock { + font-weight: bold; + } + + #cpu { + /* No styles */ + } + + #cpu.warning { + color: orange; + } + + #cpu.critical { + color: red; + } + + #memory { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + #memory.warning { + color: orange; + } + + #memory.critical { + color: red; + animation-name: blink-critical; + animation-duration: 2s; + } + + #mode { + background: #64727D; + border-top: 2px solid white; + /* To compensate for the top border and still have vertical centering */ + padding-bottom: 2px; + } + + #network { /* No styles */ - } + } - #cpu.warning { - color: orange; - } + #network.disconnected { + color: orange; + } - #cpu.critical { - color: red; - } + #pulseaudio { + /* No styles */ + } - #memory { - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - } + #pulseaudio.muted { + /* No styles */ + } - #memory.warning { - color: orange; - } + #custom-spotify { + color: rgb(102, 220, 105); + } - #memory.critical { - color: red; - animation-name: blink-critical; - animation-duration: 2s; - } + #temperature { + /* No styles */ + } - #mode { - background: #64727D; - border-top: 2px solid white; - /* To compensate for the top border and still have vertical centering */ - padding-bottom: 2px; - } + #temperature.critical { + color: red; + } - #network { - /* No styles */ - } + #tray { + /* No styles */ + } - #network.disconnected { - color: orange; - } - - #pulseaudio { - /* No styles */ - } - - #pulseaudio.muted { - /* No styles */ - } - - #custom-spotify { - color: rgb(102, 220, 105); - } - - #temperature { - /* No styles */ - } - - #temperature.critical { - color: red; - } - - #tray { - /* No styles */ - } - - #window { - font-weight: bold; - } - - #workspaces button { - border-top: 2px solid transparent; - /* To compensate for the top border and still have vertical centering */ - padding-bottom: 2px; - padding-left: 10px; - padding-right: 10px; - color: #888888; - } - - #workspaces button.focused { - border-color: #4c7899; - color: white; - background-color: #285577; - } - - #workspaces button.urgent { - border-color: #c9545d; - color: #c9545d; - } - - #idle_inhibitor { - background-color: transparent; + #window { font-weight: bold; - } + } - #idle_inhibitor.activated { - background-color: #c9545d; - color: #ffffff; - } + #workspaces button { + border-top: 2px solid transparent; + /* To compensate for the top border and still have vertical centering */ + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + color: #888888; + } - #custom-now_playing { - font-weight: bold; - } - ''; + #workspaces button.focused { + border-color: #4c7899; + color: white; + background-color: #285577; + } + + #workspaces button.urgent { + border-color: #c9545d; + color: #c9545d; + } + + #idle_inhibitor { + background-color: transparent; + font-weight: bold; + } + + #idle_inhibitor.activated { + background-color: #c9545d; + color: #ffffff; + } + + #custom-now_playing { + font-weight: bold; + } + ''; }; }; } diff --git a/home-manager/modules/zathura/default.nix b/home-manager/modules/zathura/default.nix index ee65669..863e018 100644 --- a/home-manager/modules/zathura/default.nix +++ b/home-manager/modules/zathura/default.nix @@ -1,16 +1,19 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.programs.zathura; -in { - options.eboskma.programs.zathura = { enable = mkEnableOption "activate zathura"; }; + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.programs.zathura; +in { + options.eboskma.programs.zathura = {enable = mkEnableOption "activate zathura";}; config = mkIf (cfg.enable) { programs.zathura = { enable = true; - extraConfig = (builtins.readFile ./theme); + extraConfig = builtins.readFile ./theme; }; }; } diff --git a/krops.nix b/krops.nix index 36cb689..8e56ad2 100644 --- a/krops.nix +++ b/krops.nix @@ -4,11 +4,13 @@ let }; lib = import "${krops}/lib"; - pkgs = import "${krops}/pkgs" { }; + pkgs = import "${krops}/pkgs" {}; source = name: - lib.evalSource [{ - machine-config.file = toString ./.; - }]; + lib.evalSource [ + { + machine-config.file = toString ./.; + } + ]; command = targetPath: '' nix-shell -p git --run ' @@ -23,9 +25,7 @@ let source = source name; target = target; }; - -in -rec { +in rec { # Deployments # Run with: diff --git a/machines/drone/configuration.nix b/machines/drone/configuration.nix index 480cff9..9a507d7 100644 --- a/machines/drone/configuration.nix +++ b/machines/drone/configuration.nix @@ -1,5 +1,4 @@ -{ self, ... }: -{ +{self, ...}: { imports = [ ./hardware-configuration.nix ../../users/root @@ -24,15 +23,17 @@ interfaces = { eth0 = { - ipv4.addresses = [{ - address = "10.0.0.202"; - prefixLength = 24; - }]; + ipv4.addresses = [ + { + address = "10.0.0.202"; + prefixLength = 24; + } + ]; }; }; defaultGateway = "10.0.0.1"; - nameservers = [ "10.0.0.254" ]; + nameservers = ["10.0.0.254"]; }; environment.noXlibs = true; @@ -41,8 +42,8 @@ sops.defaultSopsFile = ./secrets.yaml; sops.secrets = { - drone = { }; - drone-runner = { }; + drone = {}; + drone-runner = {}; }; system.stateVersion = "21.11"; diff --git a/machines/drone/hardware-configuration.nix b/machines/drone/hardware-configuration.nix index cea2ee0..7783659 100644 --- a/machines/drone/hardware-configuration.nix +++ b/machines/drone/hardware-configuration.nix @@ -1,5 +1,10 @@ -{ config, lib, pkgs, modulesPath, ... }: { + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/virtualisation/lxc-container.nix") ]; diff --git a/machines/loki/configuration.nix b/machines/loki/configuration.nix index 5636d1c..f9fe7f0 100644 --- a/machines/loki/configuration.nix +++ b/machines/loki/configuration.nix @@ -1,6 +1,5 @@ -{ self, ... }: -{ - imports = [ ./hardware-configuration.nix ../../users/erwin ../../users/root ]; +{self, ...}: { + imports = [./hardware-configuration.nix ../../users/erwin ../../users/root]; eboskma = { # backscrub.enable = true; @@ -29,9 +28,9 @@ }; networking = { enable = true; - dhcpInterfaces = [ "enp4s0" ]; + dhcpInterfaces = ["enp4s0"]; hosts = { - "10.0.0.252" = [ "pve.datarift.nl" ]; + "10.0.0.252" = ["pve.datarift.nl"]; }; }; nix-common = { diff --git a/machines/loki/hardware-configuration.nix b/machines/loki/hardware-configuration.nix index 50cc5c2..6c8c30d 100644 --- a/machines/loki/hardware-configuration.nix +++ b/machines/loki/hardware-configuration.nix @@ -1,39 +1,38 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" "apple-mfi-fastcharge" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd" "apple-mfi-fastcharge"]; + boot.extraModulePackages = []; - fileSystems."/" = - { - device = "/dev/disk/by-uuid/42065c7e-d0aa-4de8-a913-014cf59d48ac"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/42065c7e-d0aa-4de8-a913-014cf59d48ac"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { - device = "/dev/disk/by-uuid/4064-A1BE"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/4064-A1BE"; + fsType = "vfat"; + }; - fileSystems."/home" = - { - device = "/dev/disk/by-uuid/36d7ee19-f591-4c29-b7da-cafd9bf2c7f6"; - fsType = "ext4"; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/36d7ee19-f591-4c29-b7da-cafd9bf2c7f6"; + fsType = "ext4"; + }; - swapDevices = - [{ device = "/dev/disk/by-uuid/d93788f7-1b94-4687-8313-055d17f42b7e"; }]; + swapDevices = [{device = "/dev/disk/by-uuid/d93788f7-1b94-4687-8313-055d17f42b7e";}]; # high-resolution display hardware.video.hidpi.enable = lib.mkDefault true; diff --git a/machines/proxy/configuration.nix b/machines/proxy/configuration.nix index d33fd11..d09d4cd 100644 --- a/machines/proxy/configuration.nix +++ b/machines/proxy/configuration.nix @@ -1,5 +1,4 @@ -{ self, ... }: -{ +{self, ...}: { imports = [ ./hardware-configuration.nix ../../users/root @@ -24,15 +23,17 @@ interfaces = { eth0 = { - ipv4.addresses = [{ - address = "10.0.0.251"; - prefixLength = 24; - }]; + ipv4.addresses = [ + { + address = "10.0.0.251"; + prefixLength = 24; + } + ]; }; }; defaultGateway = "10.0.0.1"; - nameservers = [ "10.0.0.254" ]; + nameservers = ["10.0.0.254"]; }; environment.noXlibs = true; @@ -40,7 +41,7 @@ services.openssh.enable = true; sops.defaultSopsFile = ./secrets.yaml; - sops.secrets = { }; + sops.secrets = {}; system.stateVersion = "21.11"; } diff --git a/machines/proxy/hardware-configuration.nix b/machines/proxy/hardware-configuration.nix index cea2ee0..7783659 100644 --- a/machines/proxy/hardware-configuration.nix +++ b/machines/proxy/hardware-configuration.nix @@ -1,5 +1,10 @@ -{ config, lib, pkgs, modulesPath, ... }: { + config, + lib, + pkgs, + modulesPath, + ... +}: { imports = [ (modulesPath + "/virtualisation/lxc-container.nix") ]; diff --git a/machines/vm1/configuration.nix b/machines/vm1/configuration.nix index f9e4c1f..4d3411b 100644 --- a/machines/vm1/configuration.nix +++ b/machines/vm1/configuration.nix @@ -1,6 +1,5 @@ -{ self, ... }: -{ - imports = [ ./hardware-configuration.nix ]; +{self, ...}: { + imports = [./hardware-configuration.nix]; eboskma = { desktop = { diff --git a/machines/vm1/hardware-configuration.nix b/machines/vm1/hardware-configuration.nix index dc456b4..e2cc424 100644 --- a/machines/vm1/hardware-configuration.nix +++ b/machines/vm1/hardware-configuration.nix @@ -1,32 +1,31 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk"]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.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"; - }; - - swapDevices = - [{ device = "/dev/disk/by-label/swap"; }]; + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + swapDevices = [{device = "/dev/disk/by-label/swap";}]; } diff --git a/machines/vm2/configuration.nix b/machines/vm2/configuration.nix index c334df6..14ffb71 100644 --- a/machines/vm2/configuration.nix +++ b/machines/vm2/configuration.nix @@ -1,6 +1,5 @@ -{ self, ... }: -{ - imports = [ ./hardware-configuration.nix ]; +{self, ...}: { + imports = [./hardware-configuration.nix]; eboskma = { base = { diff --git a/machines/vm2/hardware-configuration.nix b/machines/vm2/hardware-configuration.nix index 24b4d3a..08dac08 100644 --- a/machines/vm2/hardware-configuration.nix +++ b/machines/vm2/hardware-configuration.nix @@ -1,32 +1,31 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ - (modulesPath + "/profiles/qemu-guest.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; - boot.initrd.kernelModules = [ "kvm-amd" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk"]; + boot.initrd.kernelModules = ["kvm-amd"]; + boot.kernelModules = ["kvm-amd"]; + boot.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"; - }; - - swapDevices = - [{ device = "/dev/disk/by-label/swap"; }]; + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + swapDevices = [{device = "/dev/disk/by-label/swap";}]; } diff --git a/modules/backscrub/default.nix b/modules/backscrub/default.nix index c97058f..62e8ee8 100644 --- a/modules/backscrub/default.nix +++ b/modules/backscrub/default.nix @@ -1,15 +1,18 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.backscrub; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.backscrub; +in { options.eboskma.backscrub = { enable = mkEnableOption "enable v4l2loopback kernel module"; }; config = mkIf (cfg.enable) { - boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; + boot.extraModulePackages = [config.boot.kernelPackages.v4l2loopback]; # Register a v4l2loopback device at boot boot.kernelModules = [ "v4l2loopback" @@ -22,6 +25,6 @@ in options v4l2loopback card_label="VirtualCam" ''; - environment.systemPackages = with pkgs; [ backscrub ]; + environment.systemPackages = with pkgs; [backscrub]; }; } diff --git a/modules/base/default.nix b/modules/base/default.nix index a1244d5..c024696 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -1,11 +1,13 @@ -{ pkgs, config, lib, ... }: -with lib; - -let - cfg = config.eboskma.base; - qmkUdevRules = (builtins.readFile ./qmk.rules); -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.base; + qmkUdevRules = builtins.readFile ./qmk.rules; +in { options.eboskma.base = { kernel = mkOption { description = "which kernel to run"; diff --git a/modules/bluetooth/default.nix b/modules/bluetooth/default.nix index ba68083..0083183 100644 --- a/modules/bluetooth/default.nix +++ b/modules/bluetooth/default.nix @@ -1,9 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.bluetooth; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.bluetooth; +in { options.eboskma.bluetooth = { enable = mkEnableOption "activate bluetooth"; }; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 5eaeac0..2626a03 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,10 +1,15 @@ -{ lib, pkgs, config, inputs, self-overlay, ... }: -with lib; -let +{ + lib, + pkgs, + config, + inputs, + self-overlay, + ... +}: +with lib; let cfg = config.eboskma.desktop; bt = config.eboskma.bluetooth; -in -{ +in { # imports = [ ../../users/erwin.nix ../../users/root.nix ]; options.eboskma.desktop = { @@ -38,7 +43,7 @@ in EDITOR = "${pkgs.neovim}/bin/nvim"; }; - nixpkgs.config = { allowUnfree = true; }; + nixpkgs.config = {allowUnfree = true;}; home.stateVersion = "21.11"; @@ -79,38 +84,39 @@ in }; }; - home.packages = with pkgs; [ - bandwhich - bitwarden - bottom - # inputs.cq-flake.packages.${pkgs.system}.cq-editor - fd - ffmpeg - ffmpeg.bin - git - gnome.nautilus - imagemagick - imv - iotop - (jetbrains.clion.override { jdk = pkgs.jetbrains.jdk; }) - mpv - nomachine-client - pamedia - pass - quintom-cursor-theme - procs - ripgrep - signal-desktop - steam - steamcmd - steam-tui - tdesktop - unzip - xdg-utils - wireshark - wl-clipboard - ] ++ - (with gst_all_1; [ gstreamer gstreamer.dev gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-vaapi ]); + home.packages = with pkgs; + [ + bandwhich + bitwarden + bottom + # inputs.cq-flake.packages.${pkgs.system}.cq-editor + fd + ffmpeg + ffmpeg.bin + git + gnome.nautilus + imagemagick + imv + iotop + (jetbrains.clion.override {jdk = pkgs.jetbrains.jdk;}) + mpv + nomachine-client + pamedia + pass + quintom-cursor-theme + procs + ripgrep + signal-desktop + steam + steamcmd + steam-tui + tdesktop + unzip + xdg-utils + wireshark + wl-clipboard + ] + ++ (with gst_all_1; [gstreamer gstreamer.dev gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-vaapi]); xdg = { enable = true; @@ -147,7 +153,7 @@ in i18n.inputMethod = { enabled = "fcitx5"; - fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-gtk fcitx5-configtool ]; + fcitx5.addons = with pkgs; [fcitx5-m17n fcitx5-gtk fcitx5-configtool]; }; gtk = { @@ -236,13 +242,13 @@ in portal = { enable = true; wlr.enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; + extraPortals = with pkgs; [xdg-desktop-portal-gtk]; gtkUsePortal = true; }; }; services = { - dbus.packages = [ pkgs.gcr ]; + dbus.packages = [pkgs.gcr]; avahi.publish.workstation = true; gvfs.enable = true; }; @@ -259,7 +265,7 @@ in updateWtmp = true; startSession = true; }; - pki.certificates = [ (builtins.readFile ./horus-ca.pem) ]; + pki.certificates = [(builtins.readFile ./horus-ca.pem)]; }; environment.sessionVariables = { @@ -278,6 +284,5 @@ in environment.etc = { "X11/xkb".source = "${pkgs.xkeyboard_config}/etc/X11/xkb"; }; - }; } diff --git a/modules/docker/default.nix b/modules/docker/default.nix index 3dd3c0f..6e099da 100644 --- a/modules/docker/default.nix +++ b/modules/docker/default.nix @@ -1,15 +1,16 @@ -{ lib, pkgs, config, ... }: -with lib; -let - cfg = config.eboskma.docker; -in { - - options.eboskma.docker = { enable = mkEnableOption "activate docker"; }; + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.docker; +in { + options.eboskma.docker = {enable = mkEnableOption "activate docker";}; config = mkIf cfg.enable { - - environment.systemPackages = with pkgs; [ docker-compose ]; + environment.systemPackages = with pkgs; [docker-compose]; virtualisation.docker = { enable = true; @@ -19,8 +20,6 @@ in }; }; - users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = - [ "docker" ]; - + users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = ["docker"]; }; } diff --git a/modules/drone/default.nix b/modules/drone/default.nix index 0bfb97b..09d1bff 100644 --- a/modules/drone/default.nix +++ b/modules/drone/default.nix @@ -1,9 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.drone; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.drone; +in { options.eboskma.drone = { enable = mkEnableOption "activate drone CI"; }; @@ -15,8 +18,8 @@ in drone = { autoStart = true; image = "drone/drone:2"; - ports = [ "8100:80" ]; - volumes = [ "drone_data:/data" ]; + ports = ["8100:80"]; + volumes = ["drone_data:/data"]; environmentFiles = [ /var/run/secrets/drone ]; @@ -25,7 +28,7 @@ in drone-runner-docker = { autoStart = true; image = "drone/drone-runner-docker:1"; - ports = [ "3000:3000" ]; + ports = ["3000:3000"]; volumes = [ "/var/run/docker.sock:/var/run/docker.sock" ]; diff --git a/modules/element-web/default.nix b/modules/element-web/default.nix index 5e1b62c..bb1a667 100644 --- a/modules/element-web/default.nix +++ b/modules/element-web/default.nix @@ -1,15 +1,16 @@ -{ lib, pkgs, config, ... }: -with lib; -let +{ + lib, + pkgs, + config, + ... +}: +with lib; let cfg = config.eboskma.element-web; matrixClientConfig = pkgs.writeText "element-web.json" (builtins.readFile ./element-web.json); -in -{ - - options.eboskma.element-web = { enable = mkEnableOption "activate element-web"; }; +in { + options.eboskma.element-web = {enable = mkEnableOption "activate element-web";}; config = mkIf cfg.enable { - eboskma.docker.enable = true; virtualisation.oci-containers.containers = { diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix index f6016af..c5a1996 100644 --- a/modules/fonts/default.nix +++ b/modules/fonts/default.nix @@ -1,19 +1,20 @@ -{ lib, pkgs, config, ... }: -with lib; -let cfg = config.eboskma.fonts; -in { - - options.eboskma.fonts = { enable = mkEnableOption "activate fonts"; }; + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.fonts; +in { + options.eboskma.fonts = {enable = mkEnableOption "activate fonts";}; config = mkIf cfg.enable { - fonts = { - fontDir.enable = true; fonts = with pkgs; [ - (nerdfonts.override { fonts = [ "CascadiaCode" "DroidSansMono" "FantasqueSansMono" "FiraCode" "Iosevka" "JetBrainsMono" "Meslo" "Noto" "SourceCodePro" ]; }) + (nerdfonts.override {fonts = ["CascadiaCode" "DroidSansMono" "FantasqueSansMono" "FiraCode" "Iosevka" "JetBrainsMono" "Meslo" "Noto" "SourceCodePro"];}) dejavu_fonts google-fonts kochi-substitute @@ -26,10 +27,10 @@ in fontconfig = { defaultFonts = { - serif = [ "Recursive Sans Casual Static Medium" ]; - sansSerif = [ "Recursive Sans Linear Static Medium" ]; - monospace = [ "Iosevka Nerd Font" ]; - emoji = [ "Noto Color Emoji" ]; + serif = ["Recursive Sans Casual Static Medium"]; + sansSerif = ["Recursive Sans Linear Static Medium"]; + monospace = ["Iosevka Nerd Font"]; + emoji = ["Noto Color Emoji"]; }; }; }; diff --git a/modules/gnome/default.nix b/modules/gnome/default.nix index cad1d80..d54750a 100644 --- a/modules/gnome/default.nix +++ b/modules/gnome/default.nix @@ -1,8 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let cfg = config.eboskma.gnome; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.gnome; +in { options.eboskma.gnome.enable = mkEnableOption "activate gnome support settings"; config = mkIf (cfg.enable) { diff --git a/modules/greetd/default.nix b/modules/greetd/default.nix index b9e6732..3f7130e 100644 --- a/modules/greetd/default.nix +++ b/modules/greetd/default.nix @@ -1,65 +1,68 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.greetd; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.greetd; +in { options.eboskma.greetd = { enable = mkEnableOption "enable greetd"; }; config = mkIf (cfg.enable) - { - services.greetd = { - enable = true; - restart = true; - settings = { - default_session = { - command = "${pkgs.sway}/bin/sway --config /etc/greetd/sway-config"; - }; + { + services.greetd = { + enable = true; + restart = true; + settings = { + default_session = { + command = "${pkgs.sway}/bin/sway --config /etc/greetd/sway-config"; }; }; - environment.systemPackages = with pkgs; [ greetd.gtkgreet quintom-cursor-theme papirus-icon-theme arc-theme ]; + }; + environment.systemPackages = with pkgs; [greetd.gtkgreet quintom-cursor-theme papirus-icon-theme arc-theme]; - environment.etc = { - "greetd/sway-config" = { - text = '' - # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. - exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit" - bindsym Mod4+shift+e exec swaynag \ - -t warning \ - -m 'What do you want to do?' \ - -b 'Poweroff' 'systemctl poweroff' \ - -b 'Reboot' 'systemctl reboot' - include /etc/sway/config.d/* - ''; - user = "greeter"; - group = "greeter"; - }; - "greetd/environments" = { - text = '' - ${pkgs.sway}/bin/sway - ${pkgs.bash}/bin/bash - ''; - user = "greeter"; - group = "greeter"; - }; - "sway/config.d/systemd-env.conf" = { - text = '' - exec_always --no-startup-id systemctl --user import-environment _JAVA_AWT_WM_NONREPARENTING MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_WAYLAND_DISABLE_WINDOWDECORATION QT_QPA_PLATFORMTHEME SDL_VIDEODRIVER SSH_AUTH_SOCK - exec_always --no-startup-id dbus-update-activation-environment --systemd _JAVA_AWT_WM_NONREPARENTING MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_WAYLAND_DISABLE_WINDOWDECORATION QT_QPA_PLATFORMTHEME SDL_VIDEODRIVER SSH_AUTH_SOCK - ''; - }; - "xdg/gtk-3.0/settings.ini" = { - text = generators.toINI { } { - Settings = { - gtk-theme-name = "Arc-Dark"; - gtk-icon-theme-name = "Papirus-Dark"; - gtk-cursor-theme-name = "Quintom_Ink"; - gtk-application-prefer-dark-theme = "true"; - }; + environment.etc = { + "greetd/sway-config" = { + text = '' + # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. + exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l; swaymsg exit" + bindsym Mod4+shift+e exec swaynag \ + -t warning \ + -m 'What do you want to do?' \ + -b 'Poweroff' 'systemctl poweroff' \ + -b 'Reboot' 'systemctl reboot' + include /etc/sway/config.d/* + ''; + user = "greeter"; + group = "greeter"; + }; + "greetd/environments" = { + text = '' + ${pkgs.sway}/bin/sway + ${pkgs.bash}/bin/bash + ''; + user = "greeter"; + group = "greeter"; + }; + "sway/config.d/systemd-env.conf" = { + text = '' + exec_always --no-startup-id systemctl --user import-environment _JAVA_AWT_WM_NONREPARENTING MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_WAYLAND_DISABLE_WINDOWDECORATION QT_QPA_PLATFORMTHEME SDL_VIDEODRIVER SSH_AUTH_SOCK + exec_always --no-startup-id dbus-update-activation-environment --systemd _JAVA_AWT_WM_NONREPARENTING MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_WAYLAND_DISABLE_WINDOWDECORATION QT_QPA_PLATFORMTHEME SDL_VIDEODRIVER SSH_AUTH_SOCK + ''; + }; + "xdg/gtk-3.0/settings.ini" = { + text = generators.toINI {} { + Settings = { + gtk-theme-name = "Arc-Dark"; + gtk-icon-theme-name = "Papirus-Dark"; + gtk-cursor-theme-name = "Quintom_Ink"; + gtk-application-prefer-dark-theme = "true"; }; }; }; }; + }; } diff --git a/modules/livebook/default.nix b/modules/livebook/default.nix index ba95f9b..71fc8eb 100644 --- a/modules/livebook/default.nix +++ b/modules/livebook/default.nix @@ -1,9 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.livebook; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.livebook; +in { options.eboskma.livebook = { enable = mkEnableOption "Start a livebook container"; dataDir = mkOption { diff --git a/modules/networking/default.nix b/modules/networking/default.nix index 5875668..5e5fada 100644 --- a/modules/networking/default.nix +++ b/modules/networking/default.nix @@ -1,8 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let cfg = config.eboskma.networking; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.networking; +in { options.eboskma.networking = { enable = mkEnableOption "activate networing settings"; @@ -21,31 +25,31 @@ in networking = { networkmanager.enable = true; interfaces = listToAttrs (builtins.map - (iface: { - name = iface; - value = { useDHCP = true; }; - }) - cfg.dhcpInterfaces); + (iface: { + name = iface; + value = {useDHCP = true;}; + }) + cfg.dhcpInterfaces); hosts = cfg.hosts; firewall = { - trustedInterfaces = [ "lo" ]; + trustedInterfaces = ["lo"]; interfaces = listToAttrs (builtins.map - (iface: { - name = iface; - value = { - allowedTCPPorts = [ - # Horus System V2 - 12345 - 5555 - 5556 - ]; - }; - }) - cfg.dhcpInterfaces); + (iface: { + name = iface; + value = { + allowedTCPPorts = [ + # Horus System V2 + 12345 + 5555 + 5556 + ]; + }; + }) + cfg.dhcpInterfaces); }; }; - users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "networkmanager" ]; + users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = ["networkmanager"]; environment.systemPackages = with pkgs; [ nmap diff --git a/modules/nginx-proxy-manager/default.nix b/modules/nginx-proxy-manager/default.nix index 9f120f7..a96fad3 100644 --- a/modules/nginx-proxy-manager/default.nix +++ b/modules/nginx-proxy-manager/default.nix @@ -1,10 +1,13 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.nginx-proxy-manager; -in { - options.eboskma.nginx-proxy-manager = { enable = mkEnableOption "Nginx Proxy Manager"; }; + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.nginx-proxy-manager; +in { + options.eboskma.nginx-proxy-manager = {enable = mkEnableOption "Nginx Proxy Manager";}; config = mkIf (cfg.enable) { eboskma.docker.enable = true; diff --git a/modules/nix-common/default.nix b/modules/nix-common/default.nix index 14cf358..5d96dda 100644 --- a/modules/nix-common/default.nix +++ b/modules/nix-common/default.nix @@ -1,8 +1,12 @@ -{ lib, pkgs, config, ... }: -with lib; -let cfg = config.eboskma.nix-common; -in { + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.nix-common; +in { options.eboskma.nix-common = { enable = mkEnableOption "activate nix-common"; disable-cache = mkEnableOption "no not use binary cache"; @@ -16,12 +20,12 @@ in nix = { package = pkgs.nixFlakes; extraOptions = '' - experimental-features = nix-command flakes + experimental-features = nix-command flakes ''; settings = { auto-optimise-store = true; - allowed-users = [ "root" ]; + allowed-users = ["root"]; substituters = [ "https://nix-community.cachix.org" ]; @@ -29,7 +33,6 @@ in trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; - }; gc = { @@ -37,7 +40,6 @@ in dates = "weekly"; options = "--delete-older-than=30d"; }; - }; }; } diff --git a/modules/options/default.nix b/modules/options/default.nix index fd8e830..17a698c 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -1,9 +1,12 @@ -{ lib, pkgs, config, ... }: -with lib; -let cfg = config.eboskma.var; -in { - + lib, + pkgs, + config, + ... +}: +with lib; let + cfg = config.eboskma.var; +in { options.eboskma.var.mainUser = lib.mkOption { type = lib.types.str; default = "erwin"; @@ -19,5 +22,4 @@ in System type ''; }; - } diff --git a/modules/sound/default.nix b/modules/sound/default.nix index 83f14b1..e07f8b1 100644 --- a/modules/sound/default.nix +++ b/modules/sound/default.nix @@ -1,8 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let cfg = config.eboskma.sound; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.sound; +in { options.eboskma.sound.enable = mkEnableOption "activate sound settings"; config = mkIf (cfg.enable) { @@ -17,10 +21,10 @@ in config = { bluez-monitor.rules = [ { - matches = [{ "device.name" = "~bluez_card.*"; }]; + matches = [{"device.name" = "~bluez_card.*";}]; actions = { "update-props" = { - "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; + "bluez5.reconnect-profiles" = ["hfp_hf" "hsp_hs" "a2dp_sink"]; "bluez5.msbc-support" = true; "bluez5.sbc-xq-support" = true; }; @@ -28,8 +32,8 @@ in } { matches = [ - { "node.name" = "~bluez_input.*"; } - { "node.name" = "~bluez_output.*"; } + {"node.name" = "~bluez_input.*";} + {"node.name" = "~bluez_output.*";} ]; actions = { "node.pause-on-idle" = false; @@ -43,8 +47,8 @@ in security.rtkit.enable = true; - environment.systemPackages = with pkgs; [ pavucontrol ]; + environment.systemPackages = with pkgs; [pavucontrol]; - users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "audio" ]; + users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = ["audio"]; }; } diff --git a/modules/systemd/default.nix b/modules/systemd/default.nix index 3afeac4..9bf72fb 100644 --- a/modules/systemd/default.nix +++ b/modules/systemd/default.nix @@ -1,9 +1,12 @@ -{ pkgs, config, lib, ... }: -with lib; -let - cfg = config.eboskma.systemd; -in { + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.eboskma.systemd; +in { options.eboskma.systemd = { enable = mkEnableOption "activate systemd settings"; }; diff --git a/overlays/default.nix b/overlays/default.nix index 0ec7418..7770d1c 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,11 +1,11 @@ final: prev: rec { - rofi-wayland = prev.pkgs.callPackage ../pkgs/rofi-wayland { }; - nix-plugins = prev.pkgs.callPackage ../pkgs/nix-plugins { }; - lunarvim = prev.pkgs.callPackage ../pkgs/lunarvim { }; + rofi-wayland = prev.pkgs.callPackage ../pkgs/rofi-wayland {}; + nix-plugins = prev.pkgs.callPackage ../pkgs/nix-plugins {}; + lunarvim = prev.pkgs.callPackage ../pkgs/lunarvim {}; backscrub = prev.pkgs.callPackage ../pkgs/backscrub - { - inherit (prev.pkgs) gcc cmake opencv curl stdenv git tensorflow-lite flatbuffers; - }; - onnx-runtime = prev.pkgs.callPackage ../pkgs/onnx-runtime { inherit (prev.pkgs) stdenv; }; - obs-backgroundremoval = prev.pkgs.callPackage ../pkgs/obs-backgroundremoval { inherit (prev.pkgs) stdenv fetchFromGitHub cmake obs-studio opencv onnx-runtime; }; + { + inherit (prev.pkgs) gcc cmake opencv curl stdenv git tensorflow-lite flatbuffers; + }; + onnx-runtime = prev.pkgs.callPackage ../pkgs/onnx-runtime {inherit (prev.pkgs) stdenv;}; + obs-backgroundremoval = prev.pkgs.callPackage ../pkgs/obs-backgroundremoval {inherit (prev.pkgs) stdenv fetchFromGitHub cmake obs-studio opencv onnx-runtime;}; } diff --git a/pkgs/backscrub/default.nix b/pkgs/backscrub/default.nix index c893e8d..0e21c28 100644 --- a/pkgs/backscrub/default.nix +++ b/pkgs/backscrub/default.nix @@ -1,4 +1,14 @@ -{ stdenv, fetchFromGitHub, cmake, opencv, gcc, curl, git, tensorflow-lite, flatbuffers }: +{ + stdenv, + fetchFromGitHub, + cmake, + opencv, + gcc, + curl, + git, + tensorflow-lite, + flatbuffers, +}: stdenv.mkDerivation { name = "backscrub"; pname = "backscrub"; @@ -11,7 +21,7 @@ stdenv.mkDerivation { sha256 = "14gd77m7dy0wg15y0i8zhki8cm7np2spx7yi162b2xqaav04b1cj"; }; - nativeBuildInputs = [ gcc cmake git ]; - buildInputs = [ opencv curl tensorflow-lite flatbuffers ]; - patches = [ ./fix-cmake-for-nixos.patch ]; + nativeBuildInputs = [gcc cmake git]; + buildInputs = [opencv curl tensorflow-lite flatbuffers]; + patches = [./fix-cmake-for-nixos.patch]; } diff --git a/pkgs/lunarvim/default.nix b/pkgs/lunarvim/default.nix index b73d0bc..005fc58 100644 --- a/pkgs/lunarvim/default.nix +++ b/pkgs/lunarvim/default.nix @@ -1,37 +1,36 @@ -{ pkgs, ... }: -with pkgs; -let - nvim-customized = wrapNeovim neovim-unwrapped { }; +{pkgs, ...}: +with pkgs; let + nvim-customized = wrapNeovim neovim-unwrapped {}; in -stdenv.mkDerivation rec { - pname = "lunarvim"; - version = "0.0.1"; + stdenv.mkDerivation rec { + pname = "lunarvim"; + version = "0.0.1"; - src = fetchFromGitHub { - owner = "LunarVim"; - repo = "LunarVim"; - rev = "0e531891b1dfd04fa02a22b48ce075120b512277"; - sha256 = "0yfr3vh8p1s9wy21s6bgpp6kp6s9pqlb6k66s76sa22vz4sjiyxb"; - }; + src = fetchFromGitHub { + owner = "LunarVim"; + repo = "LunarVim"; + rev = "0e531891b1dfd04fa02a22b48ce075120b512277"; + sha256 = "0yfr3vh8p1s9wy21s6bgpp6kp6s9pqlb6k66s76sa22vz4sjiyxb"; + }; - nativeBuildInputs = [ makeWrapper nvim-customized ]; - buildInputs = [ nvim-customized ]; + nativeBuildInputs = [makeWrapper nvim-customized]; + buildInputs = [nvim-customized]; - buildPhase = '' - echo "hello" - ''; + buildPhase = '' + echo "hello" + ''; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - cp -r $(pwd) $out/lvim - export shim="$out/lvim/utils/bin/lvim" - substituteInPlace "$shim" \ - --replace "exec nvim" "exec ${nvim-customized}/bin/nvim" - chmod +x "$shim" - makeWrapper "$shim" "$out/bin/lvim" \ - --set LUNARVIM_RUNTIME_DIR "$out" \ - --prefix PATH : ${lib.makeBinPath [ fzf git ripgrep ]} - runHook postInstall - ''; -} + installPhase = '' + runHook preInstall + mkdir -p $out/bin + cp -r $(pwd) $out/lvim + export shim="$out/lvim/utils/bin/lvim" + substituteInPlace "$shim" \ + --replace "exec nvim" "exec ${nvim-customized}/bin/nvim" + chmod +x "$shim" + makeWrapper "$shim" "$out/bin/lvim" \ + --set LUNARVIM_RUNTIME_DIR "$out" \ + --prefix PATH : ${lib.makeBinPath [fzf git ripgrep]} + runHook postInstall + ''; + } diff --git a/pkgs/nix-plugins/default.nix b/pkgs/nix-plugins/default.nix index 9bced30..d6812f2 100644 --- a/pkgs/nix-plugins/default.nix +++ b/pkgs/nix-plugins/default.nix @@ -1,5 +1,13 @@ -{ lib, stdenv, fetchFromGitHub, nixUnstable, cmake, pkg-config, boost, nlohmann_json }: - +{ + lib, + stdenv, + fetchFromGitHub, + nixUnstable, + cmake, + pkg-config, + boost, + nlohmann_json, +}: stdenv.mkDerivation rec { pname = "nix-plugins"; version = "d0df32b31f3054180741adf5865fd56d6731c572"; @@ -11,9 +19,9 @@ stdenv.mkDerivation rec { sha256 = "sha256-Zbc0iq5ZAr73B+NJvpBHm9GIJhb9qrq0vFmV/ucNT5I="; }; - nativeBuildInputs = [ cmake pkg-config ]; + nativeBuildInputs = [cmake pkg-config]; - buildInputs = [ nixUnstable boost nlohmann_json ]; + buildInputs = [nixUnstable boost nlohmann_json]; meta = { description = "Collection of miscellaneous plugins for the nix expression language"; diff --git a/pkgs/obs-backgroundremoval/default.nix b/pkgs/obs-backgroundremoval/default.nix index acb2d73..a9361bb 100644 --- a/pkgs/obs-backgroundremoval/default.nix +++ b/pkgs/obs-backgroundremoval/default.nix @@ -1,4 +1,12 @@ -{ fetchFromGitHub, stdenv, cmake, obs-studio, opencv, onnx-runtime, git }: +{ + fetchFromGitHub, + stdenv, + cmake, + obs-studio, + opencv, + onnx-runtime, + git, +}: stdenv.mkDerivation rec { pname = "obs-backgroundremoval"; version = "0.4.0"; @@ -10,9 +18,9 @@ stdenv.mkDerivation rec { sha256 = "TI1FlhE0+JL50gAZCSsI+g8savX8GRQkH3jYli/66hQ="; }; - cmakeFlags = [ "-DGIT_TAG=v${version}" ]; - patches = [ ./cmake_set_version.patch ]; + cmakeFlags = ["-DGIT_TAG=v${version}"]; + patches = [./cmake_set_version.patch]; - nativeBuildInputs = [ cmake git ]; - buildInputs = [ opencv onnx-runtime obs-studio ]; + nativeBuildInputs = [cmake git]; + buildInputs = [opencv onnx-runtime obs-studio]; } diff --git a/pkgs/onnx-runtime/default.nix b/pkgs/onnx-runtime/default.nix index 89ef24a..b5135f6 100644 --- a/pkgs/onnx-runtime/default.nix +++ b/pkgs/onnx-runtime/default.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{stdenv}: stdenv.mkDerivation { pname = "onnx-runtime"; version = "1.7.0"; diff --git a/pkgs/rofi-wayland/default.nix b/pkgs/rofi-wayland/default.nix index 5b0ffb6..ce5ccc0 100644 --- a/pkgs/rofi-wayland/default.nix +++ b/pkgs/rofi-wayland/default.nix @@ -1,51 +1,51 @@ -{ pkgs, ... }: +{pkgs, ...}: with pkgs; -stdenv.mkDerivation rec { - pname = "rofi-wayland-unwrapped"; - version = "1.7.3"; + stdenv.mkDerivation rec { + pname = "rofi-wayland-unwrapped"; + version = "1.7.3"; - src = fetchFromGitHub { - owner = "lbonn"; - repo = "rofi"; - rev = "${version}+wayland1"; - fetchSubmodules = true; - sha256 = "1h6lh4lrkxzs6iy2rzn5g71dnz6qck4j8cxpgy1ja179vrnj1sf7"; - }; + src = fetchFromGitHub { + owner = "lbonn"; + repo = "rofi"; + rev = "${version}+wayland1"; + fetchSubmodules = true; + sha256 = "1h6lh4lrkxzs6iy2rzn5g71dnz6qck4j8cxpgy1ja179vrnj1sf7"; + }; - preConfigure = '' - patchShebangs "script" - # root not present in build /etc/passwd - sed -i 's/~root/~nobody/g' test/helper-expand.c - ''; + preConfigure = '' + patchShebangs "script" + # root not present in build /etc/passwd + sed -i 's/~root/~nobody/g' test/helper-expand.c + ''; - nativeBuildInputs = [ meson ninja pkgconfig ]; - buildInputs = with pkgs; [ - libxkbcommon - pango - cairo - git - bison - flex - librsvg - check - libstartup_notification - xorg.libxcb - xorg.xcbutil - xorg.xcbutilwm - xcb-util-cursor - xcbutilxrm - which - wayland-protocols - wayland - ]; + nativeBuildInputs = [meson ninja pkgconfig]; + buildInputs = with pkgs; [ + libxkbcommon + pango + cairo + git + bison + flex + librsvg + check + libstartup_notification + xorg.libxcb + xorg.xcbutil + xorg.xcbutilwm + xcb-util-cursor + xcbutilxrm + which + wayland-protocols + wayland + ]; - doCheck = false; + doCheck = false; - meta = with lib; { - description = "Window switcher, run dialog and dmenu replacement"; - homepage = "https://github.com/davatorium/rofi"; - license = licenses.mit; - maintainers = with maintainers; [ c0deaddict ]; - platforms = with platforms; linux; - }; -} + meta = with lib; { + description = "Window switcher, run dialog and dmenu replacement"; + homepage = "https://github.com/davatorium/rofi"; + license = licenses.mit; + maintainers = with maintainers; [c0deaddict]; + platforms = with platforms; linux; + }; + } diff --git a/users/erwin/default.nix b/users/erwin/default.nix index 60c9008..8e7377a 100644 --- a/users/erwin/default.nix +++ b/users/erwin/default.nix @@ -1,9 +1,8 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { users.users.erwin = { isNormalUser = true; home = "/home/erwin"; - extraGroups = [ "wheel" "adm" "audio" "video" ]; + extraGroups = ["wheel" "adm" "audio" "video"]; shell = pkgs.fish; openssh.authorizedKeys.keyFiles = [ (pkgs.fetchurl { @@ -13,5 +12,5 @@ ]; }; - nix.settings.allowed-users = [ "erwin" ]; + nix.settings.allowed-users = ["erwin"]; } diff --git a/users/root/default.nix b/users/root/default.nix index 86a8fd6..01e199e 100644 --- a/users/root/default.nix +++ b/users/root/default.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{pkgs, ...}: { users.users.root = { openssh.authorizedKeys.keyFiles = [ (pkgs.fetchurl {