From d100c2449f7c9ea05cce5a7a4a139c4fa778af8a Mon Sep 17 00:00:00 2001 From: ooks-io Date: Fri, 15 Sep 2023 14:34:46 +1200 Subject: [PATCH] test: this is not working :,( --- flake.nix | 2 +- home/ooks/ookst480s.nix | 6 +----- home/ooks/opt/shell/default.nix | 2 +- home/ooks/standard/default.nix | 7 ++++-- nixpkgs.nix | 8 ------- overlays/default.nix | 37 ++++++++++++++------------------ system/common/global/default.nix | 1 + 7 files changed, 25 insertions(+), 38 deletions(-) delete mode 100644 nixpkgs.nix diff --git a/flake.nix b/flake.nix index c3039e9..7df066f 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,7 @@ homeManagerModules = import ./modules/home-manager; - #overlays = import ./overlays { inherit inputs outputs; }; + overlays = import ./overlays { inherit inputs outputs; }; packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; }); diff --git a/home/ooks/ookst480s.nix b/home/ooks/ookst480s.nix index 18aa6de..365ba7b 100644 --- a/home/ooks/ookst480s.nix +++ b/home/ooks/ookst480s.nix @@ -10,8 +10,4 @@ colorscheme = inputs.nix-colors.colorSchemes.everforest; - home.username = "ooks"; - home.homeDirectory = "/home/ooks"; - - programs.home-manager.enable = true; -} +} \ No newline at end of file diff --git a/home/ooks/opt/shell/default.nix b/home/ooks/opt/shell/default.nix index 0f5e9ac..d1489b9 100644 --- a/home/ooks/opt/shell/default.nix +++ b/home/ooks/opt/shell/default.nix @@ -8,7 +8,7 @@ ./starship.nix ./joshuto ./helix - # ./live-buds-cli.nix + ./live-buds-cli.nix ]; home.packages = with pkgs; [ bc # Calculator diff --git a/home/ooks/standard/default.nix b/home/ooks/standard/default.nix index a3ff9df..5b025b0 100644 --- a/home/ooks/standard/default.nix +++ b/home/ooks/standard/default.nix @@ -11,7 +11,7 @@ in nixpkgs = { config = { - #overlays = builtins.attrValues outputs.overlays; + overlays = builtins.attrValues outputs.overlays; allowUnfree = true; allowUnfreePredicate = (_: true); permittedInsecurePackages = [ @@ -38,8 +38,11 @@ in homeDirectory = lib.mkDefault "/home/${config.home.username}"; stateVersion = lib.mkDefault "22.05"; sessionPath = [ "$HOME/.local/bin" ]; + sessionVariables = { + FLAKE = "$HOME/.dotfiles/nix"; }; - + }; + colorscheme = lib.mkDefault colorSchemes.everforest; home.file.".colorscheme".text = config.colorscheme.slug; } diff --git a/nixpkgs.nix b/nixpkgs.nix deleted file mode 100644 index 792931e..0000000 --- a/nixpkgs.nix +++ /dev/null @@ -1,8 +0,0 @@ -# # A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file -# # This is useful to avoid using channels when using legacy nix commands - let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; - in - import (fetchTarball { - url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; - sha256 = lock.narHash; - }) diff --git a/overlays/default.nix b/overlays/default.nix index 9a03471..4bf8dc6 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,24 +1,19 @@ -# This file defines overlays -{ inputs, ... }: +{ outputs, inputs }: { - # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../pkgs { pkgs = final; }; - - # This one contains whatever you want to overlay - # You can change versions, add patches, set compilation flags, anything really. - # https://nixos.wiki/wiki/Overlays - modifications = final: prev: { - # example = prev.example.overrideAttrs (oldAttrs: rec { - # ... - # }); + # For every flake input, aliases 'pkgs.inputs.${flake}' to + # 'inputs.${flake}.packages.${pkgs.system}' or + # 'inputs.${flake}.legacyPackages.${pkgs.system}' + flake-inputs = final: _: { + inputs = builtins.mapAttrs + (_: flake: let + legacyPackages = ((flake.legacyPackages or {}).${final.system} or {}); + packages = ((flake.packages or {}).${final.system} or {}); + in + if legacyPackages != {} then legacyPackages else packages + ) + inputs; }; - # When applied, the unstable nixpkgs set (declared in the flake inputs) will - # be accessible through 'pkgs.unstable' - unstable-packages = final: _prev: { - unstable = import inputs.nixpkgs-unstable { - system = final.system; - config.allowUnfree = true; - }; - }; -} + # Adds my custom packages + additions = final: prev: import ../pkgs { pkgs = final; }; +} \ No newline at end of file diff --git a/system/common/global/default.nix b/system/common/global/default.nix index f3a20dd..569a538 100644 --- a/system/common/global/default.nix +++ b/system/common/global/default.nix @@ -13,6 +13,7 @@ home-manager.extraSpecialArgs = { inherit inputs outputs; }; nixpkgs = { + overlays = builtins.attrValues outputs.overlays; config = { allowUnfree = true; permittedInsecurePackages = [