From 8a6b311f86b318a6033075ff221038882a616999 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Thu, 25 Jul 2024 19:36:46 +0200 Subject: [PATCH] feat: add binary cache for emacs-overlay --- SwarselSystems.org | 56 +++++++++++++++++++------------ flake.nix | 41 +++++++++++++--------- modules/home/input.nix | 2 +- modules/home/monitors.nix | 2 +- modules/home/startup.nix | 4 +-- profiles/common/home/default.nix | 2 +- profiles/common/nixos/default.nix | 1 + profiles/common/nixos/stylix.nix | 2 +- profiles/home-manager/default.nix | 4 +-- 9 files changed, 68 insertions(+), 46 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index af3745b..597832e 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -505,20 +505,21 @@ Lastly I define some common module lists that I can simply load depending on the ); # pkgs for home-manager builds - homepkgs = import nixpkgs { system = "x86_64-linux"; - overlays = [ inputs.emacs-overlay.overlay - inputs.nur.overlay - inputs.nixgl.overlay - (final: _prev: { - stable = import inputs.nixpkgs-stable { - inherit (final) system config; - }; - }) - ]; - config.allowUnfree = true; - }; - - # NixOS modules that can only be used on NixOS systems + # homepkgs = import nixpkgs { system = "x86_64-linux"; + # overlays = [ inputs.emacs-overlay.overlay + # inputs.nur.overlay + # inputs.nixgl.overlay + # (final: _prev: { + # stable = import inputs.nixpkgs-stable { + # inherit (final) system config; + # }; + # }) + # ]; + # config.allowUnfree = true; + # }; + + # # NixOS modules that ca + n only be used on NixOS systems nixModules = [ inputs.stylix.nixosModules.stylix inputs.sops-nix.nixosModules.sops @@ -1800,10 +1801,10 @@ My old laptop, replaced by a new one, since most basic functions have stopped to #+begin_src nix :tangle profiles/home-manager/default.nix - { inputs, outputs, config, pkgs, ... }: + { inputs, outputs, config, ... }: { - imports = (builtins.attrValues outputs.homeManagerModules); + imports = builtins.attrValues outputs.homeManagerModules; nixpkgs = { inherit (outputs) overlays; @@ -4420,7 +4421,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a ***** Monitors #+begin_src nix :tangle modules/home/monitors.nix - { lib, config, ... }: + { lib, ... }: let inherit (lib) mkOption types; in @@ -4437,7 +4438,7 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a #+begin_src nix :tangle modules/home/input.nix { lib, config, ... }: let - inherit (lib) mkIf mkOption types; + inherit (lib) mkmkOption types; in { options.swarselsystems.inputs = mkOption { @@ -4494,9 +4495,9 @@ Modules that need to be loaded on the NixOS level. Note that these will not be a ***** System startup #+begin_src nix :tangle modules/home/startup.nix -{ lib, config, ... }: +{ lib, ... }: let - inherit (lib) mkIf mkOption types; + inherit (lib) mkOption types; in { @@ -4575,6 +4576,7 @@ First, we enable the use of =home-manager= as a NixoS module ./power-profiles-daemon.nix ]; + nix.settings.trusted-users = [ "swarsel" ]; home-manager = { useGlobalPkgs = true; @@ -5084,7 +5086,7 @@ By default, [[https://github.com/danth/stylix][stylix]] wants to style GRUB as w =theme= is defined in [[#h:5bc1b0c9-dc59-4c81-b5b5-e60699deda78][Theme (stylix)]]. #+begin_src nix :noweb yes :tangle profiles/common/nixos/stylix.nix - { inputs, pkgs, home-manager, config, ... }: + { pkgs, home-manager, config, ... }: { stylix = { <> @@ -5566,7 +5568,7 @@ This section houses the greetd related settings. I do not really want to use a d This section sets up all the imports that are used in the home-manager section. #+begin_src nix :tangle profiles/common/home/default.nix - { lib, pkgs, config, outputs, ... }: + { lib, pkgs, config, ... }: { imports = [ ./packages.nix @@ -7634,6 +7636,16 @@ This tangles the flake.nix file; This block only needs to be touched when updati { description = "SwarseFlake - Nix Flake for all SwarselSystems"; + nixConfig = { + extra-substituters = [ + "https://nix-community.cachix.org" + ]; + + extra-trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + inputs = { <> }; diff --git a/flake.nix b/flake.nix index c7b77ea..38a3d80 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,16 @@ { description = "SwarseFlake - Nix Flake for all SwarselSystems"; + nixConfig = { + extra-substituters = [ + "https://nix-community.cachix.org" + ]; + + extra-trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; @@ -98,22 +108,21 @@ ); # pkgs for home-manager builds - homepkgs = import nixpkgs { - system = "x86_64-linux"; - overlays = [ - inputs.emacs-overlay.overlay - inputs.nur.overlay - inputs.nixgl.overlay - (final: _prev: { - stable = import inputs.nixpkgs-stable { - inherit (final) system config; - }; - }) - ]; - config.allowUnfree = true; - }; - - # NixOS modules that can only be used on NixOS systems + # homepkgs = import nixpkgs { system = "x86_64-linux"; + # overlays = [ inputs.emacs-overlay.overlay + # inputs.nur.overlay + # inputs.nixgl.overlay + # (final: _prev: { + # stable = import inputs.nixpkgs-stable { + # inherit (final) system config; + # }; + # }) + # ]; + # config.allowUnfree = true; + # }; + + # # NixOS modules that ca + n only be used on NixOS systems nixModules = [ inputs.stylix.nixosModules.stylix inputs.sops-nix.nixosModules.sops diff --git a/modules/home/input.nix b/modules/home/input.nix index a35e6b0..8ae25d7 100644 --- a/modules/home/input.nix +++ b/modules/home/input.nix @@ -1,6 +1,6 @@ { lib, config, ... }: let - inherit (lib) mkIf mkOption types; + inherit (lib) mkmkOption types; in { options.swarselsystems.inputs = mkOption { diff --git a/modules/home/monitors.nix b/modules/home/monitors.nix index 1a9e177..e2ad06a 100644 --- a/modules/home/monitors.nix +++ b/modules/home/monitors.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ lib, ... }: let inherit (lib) mkOption types; in diff --git a/modules/home/startup.nix b/modules/home/startup.nix index 86a4d68..160a6ff 100644 --- a/modules/home/startup.nix +++ b/modules/home/startup.nix @@ -1,6 +1,6 @@ -{ lib, config, ... }: +{ lib, ... }: let - inherit (lib) mkIf mkOption types; + inherit (lib) mkOption types; in { diff --git a/profiles/common/home/default.nix b/profiles/common/home/default.nix index f068793..27723af 100644 --- a/profiles/common/home/default.nix +++ b/profiles/common/home/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, outputs, ... }: +{ lib, pkgs, config, ... }: { imports = [ ./packages.nix diff --git a/profiles/common/nixos/default.nix b/profiles/common/nixos/default.nix index 0dc82de..c0a0ab2 100644 --- a/profiles/common/nixos/default.nix +++ b/profiles/common/nixos/default.nix @@ -27,6 +27,7 @@ ./power-profiles-daemon.nix ]; + nix.settings.trusted-users = [ "swarsel" ]; home-manager = { useGlobalPkgs = true; diff --git a/profiles/common/nixos/stylix.nix b/profiles/common/nixos/stylix.nix index 6ada752..6f6fcea 100644 --- a/profiles/common/nixos/stylix.nix +++ b/profiles/common/nixos/stylix.nix @@ -1,4 +1,4 @@ -{ inputs, pkgs, home-manager, config, ... }: +{ pkgs, home-manager, config, ... }: { stylix = { diff --git a/profiles/home-manager/default.nix b/profiles/home-manager/default.nix index d6b3f99..67abaa7 100644 --- a/profiles/home-manager/default.nix +++ b/profiles/home-manager/default.nix @@ -1,7 +1,7 @@ -{ inputs, outputs, config, pkgs, ... }: +{ inputs, outputs, config, ... }: { - imports = (builtins.attrValues outputs.homeManagerModules); + imports = builtins.attrValues outputs.homeManagerModules; nixpkgs = { inherit (outputs) overlays;