diff --git a/apps/default.nix b/apps/default.nix new file mode 100644 index 00000000..4b328897 --- /dev/null +++ b/apps/default.nix @@ -0,0 +1,12 @@ +{ + inputs, + pkgs, + ... +}: let + mkApp = file: { + program = pkgs.callPackage file ({} // inputs); + type = "app"; + }; +in { + updateFlake = mkApp ./update; +} diff --git a/flake.in.nix b/flake.in.nix index 03ef2646..2b6aafc0 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -53,7 +53,7 @@ perSystem = attrs: nixpkgs.lib.genAttrs supportedSystems (system: - attrs system (mkPkgs system nixpkgs)); + attrs (mkPkgs system nixpkgs)); in { nixosModules = { adb = import ./modules/adb.nix; @@ -95,8 +95,7 @@ ]; live-image = mkNixOS [ - ("${nixpkgs}/nixos/modules/installer/" - + "cd-dvd/installation-cd-minimal.nix") + "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" {home-manager.users.nixos.home.stateVersion = "24.05";} { vars = { @@ -107,33 +106,28 @@ ]; }; - nixOnDroidConfigurations.default = mkNixOnDroid [./devices/android]; + nixOnDroidConfigurations.default = + mkNixOnDroid [./devices/android]; - legacyPackages = perSystem (system: pkgs: let - mkScope = file: - pkgs.lib.recurseIntoAttrs - (pkgs.callPackage file ({inherit mkVersion;} // inputs)); - in { - dracula = mkScope ./pkgs/dracula; - firefoxAddons = mkScope ./pkgs/firefox-addons; - mpvScripts = mkScope ./pkgs/mpv-scripts; - }); + legacyPackages = + perSystem (pkgs: + import ./legacyPackages {inherit mkVersion pkgs inputs;}); packages = - perSystem (system: pkgs: - import ./pkgs ({inherit self system pkgs mkVersion;} // inputs)); + perSystem (pkgs: + import ./packages {inherit self pkgs mkVersion inputs;}); - devShells = perSystem (_: pkgs: { + apps = + perSystem (pkgs: + import ./apps {inherit inputs pkgs;}); + + devShells = perSystem (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ - alejandra - git - nix-output-monitor - - (writeShellScriptBin "mkIso" (lib.concatStrings [ - "nom build $(realpath /etc/nixos)#nixosConfigurations." - "live-image.config.system.build.isoImage" - ])) + (writeShellScriptBin "mkIso" '' + isoConfig="nixosConfigurations.live-image.config.system.build.isoImage" + nom build $(realpath /etc/nixos)#$isoConfig + '') ]; }; @@ -161,21 +155,11 @@ }; }); - formatter = perSystem (_: pkgs: pkgs.alejandra); - - # Scripts - apps = perSystem (system: pkgs: let - inherit (pkgs) lib callPackage; - in { - updateFlake = { - program = lib.getExe (callPackage ./apps/update ({} // inputs)); - type = "app"; - }; - }); - # For nix-fast-build checks = - perSystem (system: pkgs: - import ./flake/ci.nix {inherit system pkgs self;}); + perSystem (pkgs: + import ./flake/ci.nix {inherit pkgs self;}); + + formatter = perSystem (pkgs: pkgs.alejandra); }; } diff --git a/flake/ci.nix b/flake/ci.nix index 28c0a8ee..1506279e 100644 --- a/flake/ci.nix +++ b/flake/ci.nix @@ -1,6 +1,5 @@ # CI: https://github.com/Mic92/dotfiles/blob/c2f538934d67417941f83d8bb65b8263c43d32ca/flake.nix#L168 { - system, pkgs, self, }: let @@ -9,6 +8,6 @@ nixosMachines = mapAttrs' (name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel) - ((filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); + ((filterAttrs (_: config: config.pkgs.system == pkgs.system)) self.nixosConfigurations); in nixosMachines diff --git a/legacyPackages/default.nix b/legacyPackages/default.nix new file mode 100644 index 00000000..b85a2dbf --- /dev/null +++ b/legacyPackages/default.nix @@ -0,0 +1,16 @@ +{ + inputs, + mkVersion, + pkgs, + ... +}: let + inherit (pkgs) lib; + + mkScope = file: + lib.recurseIntoAttrs + (pkgs.callPackage file ({inherit mkVersion;} // inputs)); +in { + dracula = mkScope ./dracula; + firefoxAddons = mkScope ./firefox-addons; + mpvScripts = mkScope ./mpv-scripts; +} diff --git a/pkgs/dracula/bat.nix b/legacyPackages/dracula/bat.nix similarity index 100% rename from pkgs/dracula/bat.nix rename to legacyPackages/dracula/bat.nix diff --git a/pkgs/dracula/default.nix b/legacyPackages/dracula/default.nix similarity index 100% rename from pkgs/dracula/default.nix rename to legacyPackages/dracula/default.nix diff --git a/pkgs/dracula/git.nix b/legacyPackages/dracula/git.nix similarity index 100% rename from pkgs/dracula/git.nix rename to legacyPackages/dracula/git.nix diff --git a/pkgs/dracula/gtk.nix b/legacyPackages/dracula/gtk.nix similarity index 100% rename from pkgs/dracula/gtk.nix rename to legacyPackages/dracula/gtk.nix diff --git a/pkgs/dracula/plymouth.nix b/legacyPackages/dracula/plymouth.nix similarity index 100% rename from pkgs/dracula/plymouth.nix rename to legacyPackages/dracula/plymouth.nix diff --git a/pkgs/dracula/sioyek.nix b/legacyPackages/dracula/sioyek.nix similarity index 100% rename from pkgs/dracula/sioyek.nix rename to legacyPackages/dracula/sioyek.nix diff --git a/pkgs/dracula/wallpaper.nix b/legacyPackages/dracula/wallpaper.nix similarity index 100% rename from pkgs/dracula/wallpaper.nix rename to legacyPackages/dracula/wallpaper.nix diff --git a/pkgs/firefox-addons/addons.json b/legacyPackages/firefox-addons/addons.json similarity index 100% rename from pkgs/firefox-addons/addons.json rename to legacyPackages/firefox-addons/addons.json diff --git a/pkgs/firefox-addons/default.nix b/legacyPackages/firefox-addons/default.nix similarity index 100% rename from pkgs/firefox-addons/default.nix rename to legacyPackages/firefox-addons/default.nix diff --git a/pkgs/firefox-addons/generated-firefox-addons.nix b/legacyPackages/firefox-addons/generated-firefox-addons.nix similarity index 100% rename from pkgs/firefox-addons/generated-firefox-addons.nix rename to legacyPackages/firefox-addons/generated-firefox-addons.nix diff --git a/pkgs/mpv-scripts/default.nix b/legacyPackages/mpv-scripts/default.nix similarity index 100% rename from pkgs/mpv-scripts/default.nix rename to legacyPackages/mpv-scripts/default.nix diff --git a/pkgs/mpv-scripts/kdialog-open-files.nix b/legacyPackages/mpv-scripts/kdialog-open-files.nix similarity index 100% rename from pkgs/mpv-scripts/kdialog-open-files.nix rename to legacyPackages/mpv-scripts/kdialog-open-files.nix diff --git a/pkgs/mpv-scripts/modernx.nix b/legacyPackages/mpv-scripts/modernx.nix similarity index 100% rename from pkgs/mpv-scripts/modernx.nix rename to legacyPackages/mpv-scripts/modernx.nix diff --git a/pkgs/mpv-scripts/persist-properties.nix b/legacyPackages/mpv-scripts/persist-properties.nix similarity index 100% rename from pkgs/mpv-scripts/persist-properties.nix rename to legacyPackages/mpv-scripts/persist-properties.nix diff --git a/pkgs/mpv-scripts/pointer-event.nix b/legacyPackages/mpv-scripts/pointer-event.nix similarity index 100% rename from pkgs/mpv-scripts/pointer-event.nix rename to legacyPackages/mpv-scripts/pointer-event.nix diff --git a/pkgs/mpv-scripts/touch-gestures.nix b/legacyPackages/mpv-scripts/touch-gestures.nix similarity index 100% rename from pkgs/mpv-scripts/touch-gestures.nix rename to legacyPackages/mpv-scripts/touch-gestures.nix diff --git a/pkgs/mpv-scripts/undo-redo.nix b/legacyPackages/mpv-scripts/undo-redo.nix similarity index 100% rename from pkgs/mpv-scripts/undo-redo.nix rename to legacyPackages/mpv-scripts/undo-redo.nix diff --git a/pkgs/README.md b/packages/README.md similarity index 100% rename from pkgs/README.md rename to packages/README.md diff --git a/pkgs/coloryou/LICENSE b/packages/coloryou/LICENSE similarity index 100% rename from pkgs/coloryou/LICENSE rename to packages/coloryou/LICENSE diff --git a/pkgs/coloryou/coloryou.py b/packages/coloryou/coloryou.py similarity index 100% rename from pkgs/coloryou/coloryou.py rename to packages/coloryou/coloryou.py diff --git a/pkgs/coloryou/default.nix b/packages/coloryou/default.nix similarity index 100% rename from pkgs/coloryou/default.nix rename to packages/coloryou/default.nix diff --git a/pkgs/coloryou/requirements.txt b/packages/coloryou/requirements.txt similarity index 100% rename from pkgs/coloryou/requirements.txt rename to packages/coloryou/requirements.txt diff --git a/pkgs/coloryou/setup.py b/packages/coloryou/setup.py similarity index 100% rename from pkgs/coloryou/setup.py rename to packages/coloryou/setup.py diff --git a/pkgs/coloryou/shell.nix b/packages/coloryou/shell.nix similarity index 100% rename from pkgs/coloryou/shell.nix rename to packages/coloryou/shell.nix diff --git a/pkgs/default.nix b/packages/default.nix similarity index 97% rename from pkgs/default.nix rename to packages/default.nix index 85fb90e4..fe162873 100644 --- a/pkgs/default.nix +++ b/packages/default.nix @@ -1,8 +1,9 @@ { - pkgs, + inputs, mkVersion, + pkgs, ... -} @ inputs: { +}: { coloryou = pkgs.callPackage ./coloryou {}; gpu-screen-recorder = pkgs.callPackage ./gpu-screen-recorder { diff --git a/pkgs/gpu-screen-recorder/default.nix b/packages/gpu-screen-recorder/default.nix similarity index 100% rename from pkgs/gpu-screen-recorder/default.nix rename to packages/gpu-screen-recorder/default.nix diff --git a/pkgs/pam-fprint-grosshack/default.nix b/packages/pam-fprint-grosshack/default.nix similarity index 100% rename from pkgs/pam-fprint-grosshack/default.nix rename to packages/pam-fprint-grosshack/default.nix diff --git a/pkgs/pokemon-colorscripts/default.nix b/packages/pokemon-colorscripts/default.nix similarity index 100% rename from pkgs/pokemon-colorscripts/default.nix rename to packages/pokemon-colorscripts/default.nix diff --git a/pkgs/repl/default.nix b/packages/repl/default.nix similarity index 100% rename from pkgs/repl/default.nix rename to packages/repl/default.nix diff --git a/pkgs/repl/repl.nix b/packages/repl/repl.nix similarity index 100% rename from pkgs/repl/repl.nix rename to packages/repl/repl.nix diff --git a/pkgs/trash-d/default.nix b/packages/trash-d/default.nix similarity index 100% rename from pkgs/trash-d/default.nix rename to packages/trash-d/default.nix diff --git a/pkgs/yuzu/compat-list.nix b/packages/yuzu/compat-list.nix similarity index 100% rename from pkgs/yuzu/compat-list.nix rename to packages/yuzu/compat-list.nix diff --git a/pkgs/yuzu/default.nix b/packages/yuzu/default.nix similarity index 100% rename from pkgs/yuzu/default.nix rename to packages/yuzu/default.nix diff --git a/pkgs/yuzu/mainline.nix b/packages/yuzu/mainline.nix similarity index 100% rename from pkgs/yuzu/mainline.nix rename to packages/yuzu/mainline.nix diff --git a/pkgs/yuzu/nx_tzdb.nix b/packages/yuzu/nx_tzdb.nix similarity index 100% rename from pkgs/yuzu/nx_tzdb.nix rename to packages/yuzu/nx_tzdb.nix