diff --git a/flake.nix b/flake.nix index 5151b769..808db7ec 100644 --- a/flake.nix +++ b/flake.nix @@ -340,9 +340,12 @@ networking.hostName = lib.mkOverride 2000 host'; }) (lib'.optionalAttrs (lib'.hasAttr host' images) - (let - imageFormat = images.${host'}.format; - in inputs.nixos-generators.nixosModules.${imageFormat})) + ( + let + imageFormat = images.${host'}.format; + in + inputs.nixos-generators.nixosModules.${imageFormat} + )) hostSharedConfig path ]; @@ -388,24 +391,25 @@ # My custom packages, available in here as well. Though, I mainly support # "x86_64-linux". I just want to try out supporting other systems. - packages = forAllSystems (system: let - pkgs = import nixpkgs { inherit system overlays; }; - in + packages = forAllSystems (system: + let + pkgs = import nixpkgs { inherit system overlays; }; + in inputs.flake-utils.lib.flattenTree (import ./pkgs { inherit pkgs; }) // lib'.mapAttrs' - (name: value: - lib'.nameValuePair "${name}-${value.format}" (mkImage { - inherit system pkgs extraArgs; - inherit (value) format; - extraModules = [ - ({ lib, ... }: { - networking.hostName = lib.mkOverride 2000 name; - }) - hostSharedConfig - ./hosts/${name} - ]; - })) - images); + (name: value: + lib'.nameValuePair "${name}-${value.format}" (mkImage { + inherit system pkgs extraArgs; + inherit (value) format; + extraModules = [ + ({ lib, ... }: { + networking.hostName = lib.mkOverride 2000 name; + }) + hostSharedConfig + ./hosts/${name} + ]; + })) + images); # My several development shells for usual type of projects. This is much # more preferable than installing all of the packages at the system @@ -445,31 +449,33 @@ # sensitive info such as the hostname and such. A helpful tip would be # ignoring the shell entry by simply prefixing it with a space which most # command-line shells have support for (e.g., Bash, zsh, fish). - deploy.nodes = let - nixosConfigurations = lib'.mapAttrs' - (name: value: - lib'.nameValuePair "nixos-${name}" { - hostname = name; - fastConnection = true; - profiles.system = { - sshUser = "admin"; - user = "root"; - path = inputs.deploy.lib.${defaultSystem}.activate.nixos value; - }; - }) - self.nixosConfigurations; - homeManagerConfigurations = lib'.mapAttrs' - (name: value: - lib'.nameValuePair "home-manager-${name}" { - hostname = name; - fastConnection = true; - profiles.home = { - sshUser = name; - path = inputs.deploy.lib.${defaultSystem}.activate.home-manager value; - }; - }) - self.homeManagerConfigurations; - in nixosConfigurations // homeManagerConfigurations; + deploy.nodes = + let + nixosConfigurations = lib'.mapAttrs' + (name: value: + lib'.nameValuePair "nixos-${name}" { + hostname = name; + fastConnection = true; + profiles.system = { + sshUser = "admin"; + user = "root"; + path = inputs.deploy.lib.${defaultSystem}.activate.nixos value; + }; + }) + self.nixosConfigurations; + homeManagerConfigurations = lib'.mapAttrs' + (name: value: + lib'.nameValuePair "home-manager-${name}" { + hostname = name; + fastConnection = true; + profiles.home = { + sshUser = name; + path = inputs.deploy.lib.${defaultSystem}.activate.home-manager value; + }; + }) + self.homeManagerConfigurations; + in + nixosConfigurations // homeManagerConfigurations; # How to make yourself slightly saner than before. So far the main checks # are for deploy nodes. diff --git a/hosts/ni/default.nix b/hosts/ni/default.nix index fde38343..4a1eea62 100644 --- a/hosts/ni/default.nix +++ b/hosts/ni/default.nix @@ -27,19 +27,20 @@ type = "ed25519"; }]; - sops.secrets = let - getKey = key: { - inherit key; - sopsFile = ./secrets/secrets.yaml; - }; - getSecrets = secrets: - lib.mapAttrs' - (secret: config: - lib.nameValuePair - "ni/${secret}" - ((getKey secret) // config)) - secrets; - in + sops.secrets = + let + getKey = key: { + inherit key; + sopsFile = ./secrets/secrets.yaml; + }; + getSecrets = secrets: + lib.mapAttrs' + (secret: config: + lib.nameValuePair + "ni/${secret}" + ((getKey secret) // config)) + secrets; + in getSecrets { ssh-key = { }; "ldap/password" = { }; diff --git a/hosts/plover/default.nix b/hosts/plover/default.nix index 8023dabe..0c0b1c07 100644 --- a/hosts/plover/default.nix +++ b/hosts/plover/default.nix @@ -220,7 +220,8 @@ in CREATE SCHEMA AUTHORIZATION ${user.name}; '') config.services.postgresql.ensureUsers; - in pkgs.writeText "plover-initial-postgresql-script" '' + in + pkgs.writeText "plover-initial-postgresql-script" '' ${lib.concatStringsSep "\n" perUserSchemas} ''; @@ -554,14 +555,16 @@ in IdentityFile ${config.sops.secrets."plover/borg/ssh-key".path} ''; - systemd.tmpfiles.rules = let - # To be used similarly to $GITEA_CUSTOM variable. - giteaCustomDir = "${config.services.gitea.stateDir}/custom"; - in [ - "L+ ${giteaCustomDir}/templates/home.tmpl - - - - ${./files/gitea/home.tmpl}" - "L+ ${giteaCustomDir}/public/img/logo.svg - - - - ${./files/gitea/logo.svg}" - "L+ ${giteaCustomDir}/public/img/logo.png - - - - ${./files/gitea/logo.png}" - ]; + systemd.tmpfiles.rules = + let + # To be used similarly to $GITEA_CUSTOM variable. + giteaCustomDir = "${config.services.gitea.stateDir}/custom"; + in + [ + "L+ ${giteaCustomDir}/templates/home.tmpl - - - - ${./files/gitea/home.tmpl}" + "L+ ${giteaCustomDir}/public/img/logo.svg - - - - ${./files/gitea/logo.svg}" + "L+ ${giteaCustomDir}/public/img/logo.png - - - - ${./files/gitea/logo.png}" + ]; system.stateVersion = "22.11"; } diff --git a/modules/nixos/tasks/multimedia-archive/default.nix b/modules/nixos/tasks/multimedia-archive/default.nix index cb14028b..53500b5a 100644 --- a/modules/nixos/tasks/multimedia-archive/default.nix +++ b/modules/nixos/tasks/multimedia-archive/default.nix @@ -126,9 +126,10 @@ in withDependencies = true; webserver.enable = true; - jobs = mkJobs { - db = lib.importJSON ./data/jobs.archivebox.json; - } // { + jobs = mkJobs + { + db = lib.importJSON ./data/jobs.archivebox.json; + } // { computer = { urls = [ "https://blog.mozilla.org/en/feed/" diff --git a/modules/nixos/tasks/multimedia-archive/scripts/create-jobs-from-rss-opml.py b/modules/nixos/tasks/multimedia-archive/scripts/create-jobs-from-rss-opml.py index 2cb82bba..92e00563 100755 --- a/modules/nixos/tasks/multimedia-archive/scripts/create-jobs-from-rss-opml.py +++ b/modules/nixos/tasks/multimedia-archive/scripts/create-jobs-from-rss-opml.py @@ -170,7 +170,9 @@ class Outline(object): if not category: continue - category_hierarchy = filter(lambda split: split.strip(), category.split("/")) + category_hierarchy = filter( + lambda split: split.strip(), category.split("/") + ) first_category_split = first(None, category_hierarchy) if first_category_split is None: continue @@ -231,10 +233,7 @@ def create_jobs_from_outline(root_outline: Outline, categories=[]): for subscription in outline.subscriptions: # There are some things that are meant not to be shown (i.e., # `categories`) so we're putting it in a data template. - subscription_data = { - "name": subscription.name, - "url": subscription.url - } + subscription_data = {"name": subscription.name, "url": subscription.url} if subscription.description: subscription_data["description"] = subscription.description diff --git a/pkgs/domterm/default.nix b/pkgs/domterm/default.nix index 5d0f851f..ad370321 100644 --- a/pkgs/domterm/default.nix +++ b/pkgs/domterm/default.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = with qt5; [ - autoreconfHook pkg-config + autoreconfHook + pkg-config wrapQtAppsHook qtbase qtwebchannel diff --git a/users/nixos/admin/default.nix b/users/nixos/admin/default.nix index 0eb96d04..db8b34a9 100644 --- a/users/nixos/admin/default.nix +++ b/users/nixos/admin/default.nix @@ -36,6 +36,6 @@ in # Allow the user to easily enter into several services such as the database # services to allowing some debugging. - services.postgresql.ensureUsers = [ { inherit name; } ]; - services.mysql.ensureUsers = [ { inherit name; } ]; + services.postgresql.ensureUsers = [{ inherit name; }]; + services.mysql.ensureUsers = [{ inherit name; }]; }