From 1341d9d71941eed0ee832b4c3f81ea3601b38793 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 9 Oct 2024 16:43:52 +0200 Subject: [PATCH] pbsdspkgs --- base.nix | 4 +- flake.nix | 44 ++++++++++++------- .../wl-clipboard-timeout.nix | 0 3 files changed, 31 insertions(+), 17 deletions(-) rename overlay.nix => overlays/wl-clipboard-timeout.nix (100%) diff --git a/base.nix b/base.nix index 07be098..74642f7 100644 --- a/base.nix +++ b/base.nix @@ -12,7 +12,9 @@ (ifExists ./hardware-configuration.nix ) ]; - nixpkgs.overlays = [ (import ./overlay.nix) ]; + nixpkgs.overlays = [ + (import ./overlays/wl-clipboard-timeout.nix) + ]; nixpkgs.config.permittedInsecurePackages = [ pkgs.pulsar.name diff --git a/flake.nix b/flake.nix index 42b38f9..27e3f80 100644 --- a/flake.nix +++ b/flake.nix @@ -183,9 +183,13 @@ networking.domain = domain; networking.search = [ domain ]; nixpkgs.overlays = [ + self.overlays.pbsdspkgs (final: prev: { #unstable = unstable.legacyPackages.${final.system}; - unstable = import inputs.unstable { inherit system; config.allowUnfree = true; }; # TODO: inherit nixos config from stable + unstable = import inputs.unstable { + inherit system; + config = final.pkgs.config; + }; }) ]; # This makes commandline tools like 'nix run nixpkgs#hello' @@ -290,27 +294,35 @@ nixosConfigurations = mkHosts (mkConfig []); nixosReports = mkHosts (mkReport []); - # TODO: overlays + overlays = { + pbsdspkgs = pkgs: prev: let inherit (pkgs) lib; in { + pbsds = lib.makeScope pkgs.newScope (pbsds: { + # TODO: get faketty to work, ${expect}/bin/unbuffer is bad + nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" '' + if test -t 1 && test -z "''${NIX_NO_NOM-}"; then + exec ${lib.getExe pkgs.nixos-rebuild} -L "$@" |& ${lib.getExe pkgs.nix-output-monitor} + else + exec ${lib.getExe pkgs.nixos-rebuild} -L "$@" + fi + ''; + + device-mon = pkgs.callPackage ./pkgs/device-mon {}; + #pdoc-docs = (pkgs.callPackage ./pkgs/pdocs.nix {}).pdocs; + #pdoc3-docs = (pkgs.callPackage ./pkgs/pdocs.nix {}).pdocs3; + }); + }; + wl-clipboard-timeout = ./overlays/wl-clipboard-timeout.nix; + default = self.overlays.pbsdspkgs; + }; packages = forAllSystems ({ inputs, pkgs, lib, ... }: let # TODO: by-name mk-nspawn-setup = hostname: # TODO: nspawn-tarball.nix populates /etc/nixos with junk (pkgs.callPackage ./pkgs/mk-nspawn-setup {}) (mkHosts (mkConfig [ "${nixos-nspawn}/nspawn-tarball.nix" ])).${hostname}; - in { - # TODO: get faketty to work, ${expect}/bin/unbuffer is bad - nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" '' - if test -t 1 && test -z "''${NIX_NO_NOM-}"; then - exec ${lib.getExe pkgs.nixos-rebuild} -L "$@" |& ${lib.getExe pkgs.nix-output-monitor} - else - exec ${lib.getExe pkgs.nixos-rebuild} -L "$@" - fi - ''; - - device-mon = pkgs.callPackage ./pkgs/device-mon {}; - #pdoc-docs = (pkgs.callPackage ./pkgs/pdocs.nix {}).pdocs; - #pdoc3-docs = (pkgs.callPackage ./pkgs/pdocs.nix {}).pdocs3; - + pbsdspkgs = lib.filterAttrs (name: value: lib.isDerivation value) (self.overlays.pbsdspkgs pkgs null).pbsds; + in + pbsdspkgs // { nspawn-setup-brumlebasse = mk-nspawn-setup "brumlebasse"; image-brumlebasse-openstack = nixos-generators-2311.nixosGenerate { system = "x86_64-linux"; diff --git a/overlay.nix b/overlays/wl-clipboard-timeout.nix similarity index 100% rename from overlay.nix rename to overlays/wl-clipboard-timeout.nix