From 1e7de7c2823a9beea7103249b732f14b1b1e8f78 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 13 Mar 2022 18:35:03 +0100 Subject: nvfetcher --- _sources.gup | 5 + _sources/generated.json | 196 ++++++++++++++++++++++ _sources/generated.nix | 114 +++++++++++++ accounts/gkleen@sif/default.nix | 16 +- all.gup | 4 + flake.lock | 55 ++++++ flake.nix | 29 +++- nvfetcher.toml | 43 +++++ overlays/afew.nix | 9 +- overlays/clevis.nix | 3 +- overlays/fast-cli.nix | 12 +- overlays/inwx-cdnskey/default.nix | 2 +- overlays/lego.nix | 2 +- overlays/ma1sd.nix | 60 ------- overlays/nerdfonts.nix | 2 +- overlays/nftables-prometheus-exporter/default.nix | 2 +- overlays/persistent-nix-shell/default.nix | 2 +- overlays/pidgin.nix | 57 ------- overlays/ppp.nix | 2 +- overlays/sshpass-secret.nix | 2 +- overlays/uhk-agent.nix | 13 +- overlays/urxvt/default.nix | 2 +- overlays/v4l2loopback.nix | 12 +- overlays/worktime/default.nix | 2 +- overlays/xcompose.nix | 16 +- overlays/zte-prometheus-exporter/default.nix | 2 +- shell.nix | 3 +- user-profiles/mpv/default.nix | 62 +------ 28 files changed, 477 insertions(+), 252 deletions(-) create mode 100644 _sources.gup create mode 100644 _sources/generated.json create mode 100644 _sources/generated.nix create mode 100644 all.gup create mode 100644 nvfetcher.toml delete mode 100644 overlays/ma1sd.nix delete mode 100644 overlays/pidgin.nix diff --git a/_sources.gup b/_sources.gup new file mode 100644 index 00000000..ad9f7161 --- /dev/null +++ b/_sources.gup @@ -0,0 +1,5 @@ +#!/usr/bin/env zsh + +gup -u nvfetcher.toml +[[ -d $2 ]] && cp -a $2 $1 +nvfetcher -o $1 \ No newline at end of file diff --git a/_sources/generated.json b/_sources/generated.json new file mode 100644 index 00000000..c0e62d6c --- /dev/null +++ b/_sources/generated.json @@ -0,0 +1,196 @@ +{ + "xcompose": { + "pinned": false, + "cargoLock": null, + "name": "xcompose", + "src": { + "deepClone": false, + "owner": "kragen", + "name": null, + "repo": "xcompose", + "type": "github", + "sha256": "sha256-XQ0ZuXGvDLz9fJ0yGHtgL4wl9Jx3SG30cGBM2b947iY=", + "rev": "150c47fabb9f45e81138f71347dc75f69b5dd987", + "leaveDotGit": false, + "fetchSubmodules": false + }, + "version": "150c47fabb9f45e81138f71347dc75f69b5dd987", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "fast-cli": { + "pinned": false, + "cargoLock": null, + "name": "fast-cli", + "src": { + "deepClone": false, + "owner": "gesquive", + "name": null, + "repo": "fast-cli", + "type": "github", + "sha256": "sha256-j7/3Llc3jTeJGpOH3Aexm9qcNscuk0mbi4ZCCyzC3+s=", + "rev": "v0.2.10", + "leaveDotGit": false, + "fetchSubmodules": false + }, + "version": "v0.2.10", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "mpv-createchapter": { + "pinned": false, + "cargoLock": null, + "name": "mpv-createchapter", + "src": { + "deepClone": false, + "owner": "shinchiro", + "name": null, + "repo": "mpv-createchapter", + "type": "github", + "sha256": "sha256-rPtG7mgf7tOY8Ih4Bz1tpd4MwXOxJmngjY+s70zWX+g=", + "rev": "8dd33e2debbcb963a195ec1371e02c85b49e7faa", + "leaveDotGit": false, + "fetchSubmodules": false + }, + "version": "8dd33e2debbcb963a195ec1371e02c85b49e7faa", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "v4l2loopback": { + "pinned": false, + "cargoLock": null, + "name": "v4l2loopback", + "src": { + "deepClone": false, + "owner": "umlaeute", + "name": null, + "repo": "v4l2loopback", + "type": "github", + "sha256": "sha256-lmMPHszAVHWQGYD3Qq68psW3wBm3OQ5kz+dKwJOoRxk=", + "rev": "2199283ee936b9930038552b7a0890ec1736e7a2", + "leaveDotGit": false, + "fetchSubmodules": true + }, + "version": "2199283ee936b9930038552b7a0890ec1736e7a2", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "afew": { + "pinned": false, + "cargoLock": null, + "name": "afew", + "src": { + "deepClone": false, + "owner": "gkleen", + "name": null, + "repo": "afew", + "type": "github", + "sha256": "sha256-Ipt/EvksMFihSo6t2aoQkjuxAEYdY6P4f1fhLJuGl3g=", + "rev": "8ef9a5b73e5d1063cf912c70027c655fb19d1109", + "leaveDotGit": true, + "fetchSubmodules": false + }, + "version": "8ef9a5b73e5d1063cf912c70027c655fb19d1109", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "mpv-reload": { + "pinned": false, + "cargoLock": null, + "name": "mpv-reload", + "src": { + "deepClone": false, + "owner": "4e6", + "name": null, + "repo": "mpv-reload", + "type": "github", + "sha256": "sha256-+DoKPIulQA3VSeXo8DjoxnPwDfcuCO5YHpXmB+M7EWk=", + "rev": "c1219b6ac3ee3de887e6a36ae41a8e478835ae92", + "leaveDotGit": false, + "fetchSubmodules": false + }, + "version": "c1219b6ac3ee3de887e6a36ae41a8e478835ae92", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "mpv-autosave": { + "pinned": false, + "cargoLock": null, + "name": "mpv-autosave", + "src": { + "deepClone": false, + "url": "https://gist.github.com/2f71a97fb85ed42146f6d9f522bc34ef.git", + "name": null, + "type": "git", + "sha256": "sha256-yxA8wgzdS7SyKLoNTWN87ShsBfPKUflbOu4Y0jS2G3I=", + "rev": "744c3ee61d2f0a8e9bb4e308dec6897215ae4704", + "leaveDotGit": false, + "fetchSubmodules": false + }, + "version": "744c3ee61d2f0a8e9bb4e308dec6897215ae4704", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "uhk-agent": { + "pinned": false, + "cargoLock": null, + "name": "uhk-agent", + "src": { + "url": "https://github.com/UltimateHackingKeyboard/agent/releases/download/v1.5.17/UHK.Agent-1.5.17-linux-x86_64.AppImage", + "name": null, + "type": "url", + "sha256": "sha256-auOoTTRmkXVDDvcmRFzQIStNlbai8bTBLb/KUjk6EAc=" + }, + "version": "1.5.17", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "mpv-mpris": { + "pinned": false, + "cargoLock": null, + "name": "mpv-mpris", + "src": { + "deepClone": false, + "owner": "hoyon", + "name": null, + "repo": "mpv-mpris", + "type": "github", + "sha256": "sha256-kV/d10UCYRb3IDylrU1aCOdyLEegUkwl238Cbzrbd0g=", + "rev": "0.7", + "leaveDotGit": false, + "fetchSubmodules": false + }, + "version": "0.7", + "passthru": null, + "extract": null, + "rustGitDeps": null + }, + "emacs-scratch_el": { + "pinned": false, + "cargoLock": null, + "name": "emacs-scratch_el", + "src": { + "deepClone": false, + "owner": "ffevotte", + "name": null, + "repo": "scratch.el", + "type": "github", + "sha256": "sha256-FUkKJ+1COGzgllzzv51yUIjMZI6slOFVExdwWl2ZEBA=", + "rev": "0077334cc299aa7885f804d88f52cdb1b35caf71", + "leaveDotGit": false, + "fetchSubmodules": false + }, + "version": "0077334cc299aa7885f804d88f52cdb1b35caf71", + "passthru": null, + "extract": null, + "rustGitDeps": null + } +} \ No newline at end of file diff --git a/_sources/generated.nix b/_sources/generated.nix new file mode 100644 index 00000000..221543dd --- /dev/null +++ b/_sources/generated.nix @@ -0,0 +1,114 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub }: +{ + afew = { + pname = "afew"; + version = "8ef9a5b73e5d1063cf912c70027c655fb19d1109"; + src = fetchFromGitHub ({ + owner = "gkleen"; + repo = "afew"; + rev = "8ef9a5b73e5d1063cf912c70027c655fb19d1109"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = true; + sha256 = "sha256-Ipt/EvksMFihSo6t2aoQkjuxAEYdY6P4f1fhLJuGl3g="; + }); + }; + emacs-scratch_el = { + pname = "emacs-scratch_el"; + version = "0077334cc299aa7885f804d88f52cdb1b35caf71"; + src = fetchFromGitHub ({ + owner = "ffevotte"; + repo = "scratch.el"; + rev = "0077334cc299aa7885f804d88f52cdb1b35caf71"; + fetchSubmodules = false; + sha256 = "sha256-FUkKJ+1COGzgllzzv51yUIjMZI6slOFVExdwWl2ZEBA="; + }); + }; + fast-cli = { + pname = "fast-cli"; + version = "v0.2.10"; + src = fetchFromGitHub ({ + owner = "gesquive"; + repo = "fast-cli"; + rev = "v0.2.10"; + fetchSubmodules = false; + sha256 = "sha256-j7/3Llc3jTeJGpOH3Aexm9qcNscuk0mbi4ZCCyzC3+s="; + }); + }; + mpv-autosave = { + pname = "mpv-autosave"; + version = "744c3ee61d2f0a8e9bb4e308dec6897215ae4704"; + src = fetchgit { + url = "https://gist.github.com/2f71a97fb85ed42146f6d9f522bc34ef.git"; + rev = "744c3ee61d2f0a8e9bb4e308dec6897215ae4704"; + fetchSubmodules = false; + deepClone = false; + leaveDotGit = false; + sha256 = "sha256-yxA8wgzdS7SyKLoNTWN87ShsBfPKUflbOu4Y0jS2G3I="; + }; + }; + mpv-createchapter = { + pname = "mpv-createchapter"; + version = "8dd33e2debbcb963a195ec1371e02c85b49e7faa"; + src = fetchFromGitHub ({ + owner = "shinchiro"; + repo = "mpv-createchapter"; + rev = "8dd33e2debbcb963a195ec1371e02c85b49e7faa"; + fetchSubmodules = false; + sha256 = "sha256-rPtG7mgf7tOY8Ih4Bz1tpd4MwXOxJmngjY+s70zWX+g="; + }); + }; + mpv-mpris = { + pname = "mpv-mpris"; + version = "0.7"; + src = fetchFromGitHub ({ + owner = "hoyon"; + repo = "mpv-mpris"; + rev = "0.7"; + fetchSubmodules = false; + sha256 = "sha256-kV/d10UCYRb3IDylrU1aCOdyLEegUkwl238Cbzrbd0g="; + }); + }; + mpv-reload = { + pname = "mpv-reload"; + version = "c1219b6ac3ee3de887e6a36ae41a8e478835ae92"; + src = fetchFromGitHub ({ + owner = "4e6"; + repo = "mpv-reload"; + rev = "c1219b6ac3ee3de887e6a36ae41a8e478835ae92"; + fetchSubmodules = false; + sha256 = "sha256-+DoKPIulQA3VSeXo8DjoxnPwDfcuCO5YHpXmB+M7EWk="; + }); + }; + uhk-agent = { + pname = "uhk-agent"; + version = "1.5.17"; + src = fetchurl { + url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v1.5.17/UHK.Agent-1.5.17-linux-x86_64.AppImage"; + sha256 = "sha256-auOoTTRmkXVDDvcmRFzQIStNlbai8bTBLb/KUjk6EAc="; + }; + }; + v4l2loopback = { + pname = "v4l2loopback"; + version = "2199283ee936b9930038552b7a0890ec1736e7a2"; + src = fetchFromGitHub ({ + owner = "umlaeute"; + repo = "v4l2loopback"; + rev = "2199283ee936b9930038552b7a0890ec1736e7a2"; + fetchSubmodules = true; + sha256 = "sha256-lmMPHszAVHWQGYD3Qq68psW3wBm3OQ5kz+dKwJOoRxk="; + }); + }; + xcompose = { + pname = "xcompose"; + version = "150c47fabb9f45e81138f71347dc75f69b5dd987"; + src = fetchFromGitHub ({ + owner = "kragen"; + repo = "xcompose"; + rev = "150c47fabb9f45e81138f71347dc75f69b5dd987"; + fetchSubmodules = false; + sha256 = "sha256-XQ0ZuXGvDLz9fJ0yGHtgL4wl9Jx3SG30cGBM2b947iY="; + }); + }; +} diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 7c75af98..7e064e6a 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -1,25 +1,15 @@ -{ flake, flakeInputs, userName, pkgs, customUtils, lib, config, ... }@inputs: +{ flake, flakeInputs, userName, pkgs, customUtils, lib, config, sources, ... }@inputs: let cfg = config.home-manager.users.${userName}; xmonad = import ./xmonad pkgs.haskellPackages; - emacsScratch = pkgs.stdenv.mkDerivation rec { - pname = "scratch"; - version = "0077334cc299aa7885f804d88f52cdb1b35caf71"; - - src = pkgs.fetchFromGitHub { - owner = "ffevotte"; - repo = "scratch.el"; - rev = version; - sha256 = "sha256-FUkKJ+1COGzgllzzv51yUIjMZI6slOFVExdwWl2ZEBA="; - }; - + emacsScratch = pkgs.stdenv.mkDerivation (sources.emacs-scratch_el // rec { phases = [ "installPhase" ]; installPhase = '' mkdir -p $out/share/emacs/site-lisp cp $src/scratch.el $out/share/emacs/site-lisp/default.el ''; - }; + }); muteScript = pkgs.stdenv.mkDerivation { name = "mute"; src = ./scripts/mute.zsh; diff --git a/all.gup b/all.gup new file mode 100644 index 00000000..40ab2269 --- /dev/null +++ b/all.gup @@ -0,0 +1,4 @@ +#!/usr/bin/env zsh + +gup -u _sources +gup -u flake.lock \ No newline at end of file diff --git a/flake.lock b/flake.lock index 4ad8f399..503197cc 100644 --- a/flake.lock +++ b/flake.lock @@ -39,6 +39,37 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -76,11 +107,35 @@ "type": "github" } }, + "nvfetcher": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1644123018, + "narHash": "sha256-xEhhLmuy4FnT4Zdkf3epPX9T3xqn59yERCsicG4IEyM=", + "owner": "berberman", + "repo": "nvfetcher", + "rev": "9f2cb15c4668859312b6a854d79ad753d5b98b03", + "type": "github" + }, + "original": { + "owner": "berberman", + "ref": "master", + "repo": "nvfetcher", + "type": "github" + } + }, "root": { "inputs": { "deploy-rs": "deploy-rs", "home-manager": "home-manager", "nixpkgs": "nixpkgs", + "nvfetcher": "nvfetcher", "sops-nix": "sops-nix" } }, diff --git a/flake.nix b/flake.nix index 5a62065d..f5008748 100644 --- a/flake.nix +++ b/flake.nix @@ -29,9 +29,16 @@ ref = "master"; inputs.nixpkgs.follows = "nixpkgs"; }; + nvfetcher = { + type = "github"; + owner = "berberman"; + repo = "nvfetcher"; + ref = "master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, ... }@inputs: + outputs = { self, nixpkgs, home-manager, sops-nix, deploy-rs, nvfetcher, ... }@inputs: let inherit (builtins) attrNames attrValues elemAt toJSON isNull pathExists; inherit (nixpkgs) lib; @@ -48,6 +55,10 @@ accountName' = splitString "@" accountName; in elemAt accountName' 1; + mkSources = pkgs: optionalAttrs (pathExists _sources/generated.nix) { sources = pkgs.callPackage _sources/generated.nix {}; }; + + mkOverlay = path: final: prev: import path ({ inherit final; inherit prev; } // mkSources prev); + mkNixosConfiguration = addProfiles: dir: path: hostName: nixosSystem rec { specialArgs = { flake = self; @@ -61,9 +72,11 @@ ]; local = dir + "/${path}"; - argsModule._module.args = { - customUtils = utils; - inherit hostName; + argsModule = { pkgs, ... }: { + _module.args = { + customUtils = utils; + inherit hostName; + } // mkSources pkgs; }; accountModules = attrValues (filterAttrs accountMatchesHost self.nixosModules.accounts); accountMatchesHost = n: _v: accountHostName n == hostName; @@ -154,7 +167,7 @@ homeConfigurations = listToAttrs (concatLists (mapAttrsToList (hostname: nixosConfig: mapAttrsToList (username: configuration: nameValuePair "${username}@${hostname}" { inherit (configuration.home) activationPackage; }) nixosConfig.config.home-manager.users) self.nixosConfigurations)); overlays = let - overlays = mapAttrs (_name: path: import path) overlayPaths; + overlays = mapAttrs (_name: path: mkOverlay path) overlayPaths; in overlays // { default = final: prev: composeManyExtensions (attrValues overlays) final prev; }; overlays-path = forAllSystems (system: _: self.legacyPackages.${system}.writeText "overlays.nix" '' map import (builtins.attrValues (builtins.fromJSON ${self.legacyPackages.${system}.lib.strings.escapeNixString (toJSON overlayPaths)})) @@ -167,7 +180,11 @@ apps = activateNixosConfigurations; - devShells = forAllSystems (system: systemPkgs: { default = import ./shell.nix { pkgs = self.legacyPackages.${system}; deploy-rs = deploy-rs.defaultPackage.${system}; }; }); + devShells = forAllSystems (system: systemPkgs: { default = import ./shell.nix { + pkgs = self.legacyPackages.${system}; + deploy-rs = deploy-rs.packages.${system}.deploy-rs; + nvfetcher = nvfetcher.defaultPackage.${system}; + };}); templates.default = { path = ./.; diff --git a/nvfetcher.toml b/nvfetcher.toml new file mode 100644 index 00000000..e82051cd --- /dev/null +++ b/nvfetcher.toml @@ -0,0 +1,43 @@ +[mpv-reload] +src.git = "https://github.com/4e6/mpv-reload" +fetch.github = "4e6/mpv-reload" + +[mpv-createchapter] +src.git = "https://github.com/shinchiro/mpv-createchapter" +fetch.github = "shinchiro/mpv-createchapter" + +[mpv-autosave] +src.git = "https://gist.github.com/2f71a97fb85ed42146f6d9f522bc34ef.git" +fetch.git = "https://gist.github.com/2f71a97fb85ed42146f6d9f522bc34ef.git" + +[mpv-mpris] +src.github = "hoyon/mpv-mpris" +fetch.github = "hoyon/mpv-mpris" + +[emacs-scratch_el] +src.git = "https://github.com/ffevotte/scratch.el" +fetch.github = "ffevotte/scratch.el" + + +[afew] +src.git = "https://github.com/gkleen/afew" +fetch.github = "gkleen/afew" +git.leaveDotGit = true + +[uhk-agent] +src.github = "UltimateHackingKeyboard/agent" +src.prefix = "v" +fetch.url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v$ver/UHK.Agent-$ver-linux-x86_64.AppImage" + +[v4l2loopback] +src.git = "https://github.com/umlaeute/v4l2loopback" +fetch.github = "umlaeute/v4l2loopback" +git.fetchSubmodules = true + +[fast-cli] +src.github = "gesquive/fast-cli" +fetch.github = "gesquive/fast-cli" + +[xcompose] +src.git = "https://github.com/kragen/xcompose" +fetch.github = "kragen/xcompose" \ No newline at end of file diff --git a/overlays/afew.nix b/overlays/afew.nix index 5075d678..17331799 100644 --- a/overlays/afew.nix +++ b/overlays/afew.nix @@ -1,11 +1,6 @@ -final: prev: { +{ final, prev, sources, ... }: { afew = prev.afew.overrideAttrs (oldAttrs: { - src = prev.fetchgit { - url = "https://github.com/gkleen/afew.git"; - rev = "7b96c73000152188bf8ec9168721f26f5bd01aa6"; - sha256 = "09pmfyxq2j0rqvdisahpxpskvxckksx6gq9axdc83ppkws25iprm"; - leaveDotGit = true; - }; + inherit (sources.afew) version afew; nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ final.git ]; }); diff --git a/overlays/clevis.nix b/overlays/clevis.nix index a786340c..1cc1a717 100644 --- a/overlays/clevis.nix +++ b/overlays/clevis.nix @@ -1,5 +1,4 @@ -final: prev: -{ +{ final, prev, ... }: { clevis = prev.clevis.overrideAttrs (oldAttrs: { buildInputs = (oldAttrs.buildInputs or []) ++ [final.tpm2-tools]; nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [final.makeWrapper]; diff --git a/overlays/fast-cli.nix b/overlays/fast-cli.nix index 314d3796..932c5a38 100644 --- a/overlays/fast-cli.nix +++ b/overlays/fast-cli.nix @@ -1,14 +1,8 @@ -final: prev: { +{ final, prev, sources, ... }: { fast-cli = prev.buildGoModule rec { pname = "fast-cli"; - version = "0.2.10"; - src = prev.fetchFromGitHub { - owner = "gesquive"; - repo = pname; - rev = "v${version}"; - hash = "sha256-j7/3Llc3jTeJGpOH3Aexm9qcNscuk0mbi4ZCCyzC3+s="; - }; + inherit (sources.fast-cli) version src; vendorSha256 = "sha256-XM/5kUau0JBMxN0UpX6QNI31i8/+HNFvgFUFtlJsBh0="; preBuild = let @@ -34,7 +28,7 @@ final: prev: { ''; ldflags = [ - "-X main.version=${version}" + "-X main.version=${prev.lib.removePrefix "v" version}" ]; }; } diff --git a/overlays/inwx-cdnskey/default.nix b/overlays/inwx-cdnskey/default.nix index c19c2df5..cd564f24 100644 --- a/overlays/inwx-cdnskey/default.nix +++ b/overlays/inwx-cdnskey/default.nix @@ -1,4 +1,4 @@ -final: prev: +{ final, prev, ... }: let packageOverrides = final.callPackage ./python-packages.nix {}; inpPython = final.python39.override { inherit packageOverrides; }; diff --git a/overlays/lego.nix b/overlays/lego.nix index 80e9bd4b..83b1e2e8 100644 --- a/overlays/lego.nix +++ b/overlays/lego.nix @@ -1,4 +1,4 @@ -final: prev: { +{ final, prev, ... }: { lego = prev.lego.override { buildGoModule = args: prev.buildGoModule (args // { patches = (args.patches or []) ++ prev.lib.lists.singleton (prev.fetchpatch { diff --git a/overlays/ma1sd.nix b/overlays/ma1sd.nix deleted file mode 100644 index 3218879b..00000000 --- a/overlays/ma1sd.nix +++ /dev/null @@ -1,60 +0,0 @@ -final: prev: { - ma1sd = let - pname = "ma1sd"; - version = "2.5.0"; - rev = version; - - src = prev.fetchFromGitHub { - inherit rev; - owner = "ma1uta"; - repo = "ma1sd"; - hash = "sha256-K3kaujAhWsRQuTMW3SZOnE7Rmu8+tDXaxpLrb45OI4A="; - }; - - - deps = prev.stdenv.mkDerivation { - pname = "${pname}-deps"; - inherit src version; - nativeBuildInputs = with final; [ gradle_6 perl git ]; - - buildPhase = '' - export MA1SD_BUILD_VERSION=${rev} - export GRADLE_USER_HOME=$(mktemp -d); - gradle --no-daemon build -x test - ''; - - # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar) - installPhase = '' - find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \ - | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \ - | sh - ''; - - dontStrip = true; - - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "sha256-P81aY1rOnZdb2UskPIrBe8dfWAicJ3TivBv/NEns5ro="; - }; - in prev.stdenv.mkDerivation { - inherit pname src version; - nativeBuildInputs = with final; [ gradle_6 perl makeWrapper ]; - buildInputs = with final; [ jre ]; - - buildPhase = '' - runHook preBuild - export MA1SD_BUILD_VERSION=${rev} - export GRADLE_USER_HOME=$(mktemp -d) - sed -ie "s#mavenCentral()#mavenLocal(); maven { url '${deps}' }#g; s#mavenCentral()##g" build.gradle - gradle --offline --no-daemon build -x test - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - install -D build/libs/source.jar $out/lib/ma1sd.jar - makeWrapper ${final.jre}/bin/java $out/bin/ma1sd --add-flags "-jar $out/lib/ma1sd.jar" - runHook postInstall - ''; - }; -} diff --git a/overlays/nerdfonts.nix b/overlays/nerdfonts.nix index 28581d72..f4fc6f14 100644 --- a/overlays/nerdfonts.nix +++ b/overlays/nerdfonts.nix @@ -1,4 +1,4 @@ -final: prev: { +{ final, prev, ... }: { nerdfonts = prev.nerdfonts.override { fonts = ["FiraMono" "FiraCode"]; }; diff --git a/overlays/nftables-prometheus-exporter/default.nix b/overlays/nftables-prometheus-exporter/default.nix index 452f160f..aab0c8e9 100644 --- a/overlays/nftables-prometheus-exporter/default.nix +++ b/overlays/nftables-prometheus-exporter/default.nix @@ -1,4 +1,4 @@ -final: prev: +{ final, prev, ... }: let inpPython = final.python310; in { diff --git a/overlays/persistent-nix-shell/default.nix b/overlays/persistent-nix-shell/default.nix index 60396335..c36b9e86 100644 --- a/overlays/persistent-nix-shell/default.nix +++ b/overlays/persistent-nix-shell/default.nix @@ -1,4 +1,4 @@ -final: prev: { +{ final, prev, ... }: { persistent-nix-shell = prev.stdenv.mkDerivation { name = "persistent-nix-shell"; src = ./persistent-nix-shell; diff --git a/overlays/pidgin.nix b/overlays/pidgin.nix deleted file mode 100644 index 4c315f55..00000000 --- a/overlays/pidgin.nix +++ /dev/null @@ -1,57 +0,0 @@ -final: prev: -let - mucHistory = prev.fetchpatch { - url = "https://developer.pidgin.im/raw-attachment/ticket/16524/0001-only-request-unseed-chat-history-from-jabber-group-c.patch"; - sha256 = "083wvmq7417xz55fxxhllqwql1hgjvin2sak08844121yw1jvc44"; - }; - - pidginWrapper = { symlinkJoin, pidgin, makeWrapper, plugins }: - let - extraArgs = map (x: x.wrapArgs or "") plugins; - majorVersion = prev.lib.versions.major pidgin.version; - in symlinkJoin { - name = "pidgin-with-plugins-${pidgin.version}"; - - paths = [ pidgin ] ++ plugins; - - buildInputs = [ makeWrapper ]; - - postBuild = '' - wrapProgram $out/bin/pidgin \ - --suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${majorVersion} $out/lib/pidgin" \ - ${toString extraArgs} - wrapProgram $out/bin/finch \ - --suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${majorVersion}" \ - ${toString extraArgs} - ''; - }; -in { - pidgin-rocketchat = let - rev = "5c08ad0eacd39914d27b692d7eb42a94a991fb4c"; - in prev.stdenv.mkDerivation { - pname = "pidgin-rocketchat"; - version = builtins.substring 0 8 rev; - - src = prev.fetchFromGitHub { - owner = "EionRobb"; - repo = "purple-rocketchat"; - inherit rev; - hash = "sha256-UBIp5tpj4Xfo+mPhY51+rzs+ojKr90zWK+XLiK7XvWM="; - }; - - nativeBuildInputs = with final; [ pidgin json-glib glib discount ]; - - installFlags = [ - "ROCKETCHAT_DEST=$(out)/lib/purple-2" - "ROCKETCHAT_ICONS_DEST=$(out)/share/pixmaps/pidgin/protocols" - ]; - }; - - pidgin-with-plugins = pidginWrapper { - inherit (prev) makeWrapper symlinkJoin; - plugins = with final; [ purple-lurch pidgin-carbons pidgin-opensteamworks pidgin-xmpp-receipts pidgin-rocketchat ]; - pidgin = prev.pidgin.overrideAttrs (oldAttrs: { - patches = (oldAttrs.patches or []) ++ [mucHistory]; - }); - }; -} diff --git a/overlays/ppp.nix b/overlays/ppp.nix index 38aeaef0..8c6b0798 100644 --- a/overlays/ppp.nix +++ b/overlays/ppp.nix @@ -1,4 +1,4 @@ -final: prev: { +{ final, prev, ... }: { ppp = prev.ppp.overrideAttrs (oldAttrs: { buildInputs = (oldAttrs.buildInputs or []) ++ [ final.systemd ]; makeFlags = (oldAttrs.makeFlags or []) ++ [ "SYSTEMD=yes" ]; diff --git a/overlays/sshpass-secret.nix b/overlays/sshpass-secret.nix index 2f3d6169..388471cb 100644 --- a/overlays/sshpass-secret.nix +++ b/overlays/sshpass-secret.nix @@ -1,4 +1,4 @@ -final: prev: { +{ final, prev, ... }: { sshpassSecret = prev.writeScriptBin "sshpass-secret" '' #!${final.zsh}/bin/zsh -e diff --git a/overlays/uhk-agent.nix b/overlays/uhk-agent.nix index 1b37121f..fcf66c0b 100644 --- a/overlays/uhk-agent.nix +++ b/overlays/uhk-agent.nix @@ -1,19 +1,12 @@ -final: prev: +{ final, prev, sources, ... }: { uhk-agent = let - version = "1.5.15"; - - image = prev.stdenv.mkDerivation { - name = "uhk-agent-image"; - src = prev.fetchurl { - url = "https://github.com/UltimateHackingKeyboard/agent/releases/download/v${version}/UHK.Agent-${version}-linux-x86_64.AppImage"; - hash = "sha256-t2Jwd/x0eTZ4xBaCb/FomH/zSRLt7IIERUF9n9ONCpE="; - }; + image = prev.stdenv.mkDerivation (sources.uhk-agent // { buildCommand = '' install -m 0644 $src $out ''; - }; + }); appimage-run' = prev.appimage-run.override { extraPkgs = p: with p; [ diff --git a/overlays/urxvt/default.nix b/overlays/urxvt/default.nix index 3c57d000..77a2c51f 100644 --- a/overlays/urxvt/default.nix +++ b/overlays/urxvt/default.nix @@ -1,4 +1,4 @@ -final: prev: { +{ final, prev, ... }: { rxvt_unicode-with-plugins = prev.rxvt-unicode.override { configure = { availablePlugins, ... }: { plugins = [ final.urxvt_osc_52 ] ++ builtins.attrValues availablePlugins; diff --git a/overlays/v4l2loopback.nix b/overlays/v4l2loopback.nix index 335f86a3..bb59961f 100644 --- a/overlays/v4l2loopback.nix +++ b/overlays/v4l2loopback.nix @@ -1,16 +1,8 @@ -final: prev: { +{ final, prev, sources, ... }: { linuxPackages_latest = prev.linuxPackages_latest.extend (self: super: { v4l2loopback = super.stdenv.mkDerivation rec { name = "v4l2loopback-${version}-${self.kernel.version}"; - version = "f62fb9076b6313e5eb82fdcaceadb6b3052f346e"; - - src = prev.fetchFromGitHub { - owner = "umlaeute"; - repo = "v4l2loopback"; - rev = "${version}"; - sha256 = "VRFtimQQtT8vd1dx5KtUDkmXo3DSOybhNLcAIxQba44="; - fetchSubmodules = true; - }; + inherit (sources.v4l2loopback) version src; hardeningDisable = [ "format" "pic" ]; diff --git a/overlays/worktime/default.nix b/overlays/worktime/default.nix index a8fe79c6..4322f719 100644 --- a/overlays/worktime/default.nix +++ b/overlays/worktime/default.nix @@ -1,4 +1,4 @@ -final: prev: { +{ final, prev, ... }: { worktime = prev.stdenv.mkDerivation rec { name = "worktime"; src = ./worktime.py; diff --git a/overlays/xcompose.nix b/overlays/xcompose.nix index 2bcd6c01..e7603b83 100644 --- a/overlays/xcompose.nix +++ b/overlays/xcompose.nix @@ -1,17 +1,5 @@ -final: prev: { - xcompose = prev.stdenv.mkDerivation (let - rev = "150c47fabb9f45e81138f71347dc75f69b5dd987"; - in { - pname = "xcompose"; - version = builtins.substring 0 8 rev; - - src = prev.fetchFromGitHub { - owner = "kragen"; - repo = "xcompose"; - inherit rev; - hash = "sha256-XQ0ZuXGvDLz9fJ0yGHtgL4wl9Jx3SG30cGBM2b947iY="; - }; - +{ final, prev, sources, ... }: { + xcompose = prev.stdenv.mkDerivation (sources.xcompose // { nativeBuildInputs = with final; [ perl ]; postPatch = '' diff --git a/overlays/zte-prometheus-exporter/default.nix b/overlays/zte-prometheus-exporter/default.nix index 1609724b..2188e7b3 100644 --- a/overlays/zte-prometheus-exporter/default.nix +++ b/overlays/zte-prometheus-exporter/default.nix @@ -1,4 +1,4 @@ -final: prev: +{ final, prev, ... }: let packageOverrides = final.callPackage ./python-packages.nix {}; inpPython = final.python310.override { inherit packageOverrides; }; diff --git a/shell.nix b/shell.nix index 233d1cbe..05ba992b 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -{ pkgs ? import {}, deploy-rs }: +{ pkgs ? import {}, deploy-rs, nvfetcher }: let nixWithFlakes = pkgs.symlinkJoin { name = "nix-with-flakes"; @@ -24,5 +24,6 @@ in pkgs.mkShell { tai64dec knot-dns yq + nvfetcher ]; } diff --git a/user-profiles/mpv/default.nix b/user-profiles/mpv/default.nix index f6f9b8b2..4d6e3ea6 100644 --- a/user-profiles/mpv/default.nix +++ b/user-profiles/mpv/default.nix @@ -1,4 +1,4 @@ -{ config, lib, userName, pkgs, ... }: +{ config, lib, userName, pkgs, sources, ... }: { home-manager.users.${userName}.programs.mpv = { enable = true; @@ -21,75 +21,31 @@ ]; }; scripts = [ - (pkgs.stdenv.mkDerivation rec { - version = "2b8a719f"; - pname = "reload"; - name = "${pname}-${version}"; - - src = pkgs.fetchFromGitHub { - owner = "4e6"; - repo = "mpv-reload"; - rev = "2b8a719fe166d6d42b5f1dd64761f97997b54a86"; - sha256 = "19ycvnwzf8vgv0g63d4k1ll6hlfrd92is9gl8hzfic7w32ycphbg"; - }; - + (pkgs.stdenv.mkDerivation (sources.mpv-reload // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 reload.lua $out/share/mpv/scripts/${passthru.scriptName} ''; passthru.scriptName = "reload.lua"; - }) - (pkgs.stdenv.mkDerivation rec { - version = "8dd33e2d"; - pname = "createchapter"; - name = "${pname}-${version}"; - - src = pkgs.fetchFromGitHub { - owner = "shinchiro"; - repo = "mpv-createchapter"; - rev = "8dd33e2debbcb963a195ec1371e02c85b49e7faa"; - hash = "sha256-rPtG7mgf7tOY8Ih4Bz1tpd4MwXOxJmngjY+s70zWX+g="; - }; - + })) + (pkgs.stdenv.mkDerivation (sources.mpv-createchapter // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 createchapter.lua $out/share/mpv/scripts/${passthru.scriptName} ''; passthru.scriptName = "createchapter.lua"; - }) - (pkgs.stdenv.mkDerivation rec { - version = "744c3ee6"; - pname = "autosave"; - name = "${pname}-${version}.lua"; - - src = pkgs.fetchzip { - url = "https://gist.github.com/CyberShadow/2f71a97fb85ed42146f6d9f522bc34ef/archive/744c3ee61d2f0a8e9bb4e308dec6897215ae4704.zip"; - hash = "sha256-yxA8wgzdS7SyKLoNTWN87ShsBfPKUflbOu4Y0jS2G3I="; - # url = "https://gist.github.com/Hakkin/5489e511bd6c8068a0fc09304c9c5a82/archive/7a19f7cdb6dd0b1c6878b41e13b244e2503c15fc.zip"; - # sha256 = "0bv9wjrqm2ragd7rp8vw768bja2ghascwlljd6rzzf2ybi10fxs2"; - }; - + })) + (pkgs.stdenv.mkDerivation (sources.mpv-autosave // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 autosave.lua $out/share/mpv/scripts/${passthru.scriptName} ''; passthru.scriptName = "autosave.lua"; - }) - (pkgs.stdenv.mkDerivation rec { - version = "0.4"; - pname = "mpv-mpris"; - name = "${pname}-${version}.so"; - - src = pkgs.fetchFromGitHub { - owner = "hoyon"; - repo = "mpv-mpris"; - rev = version; - sha256 = "1fr3jvja8s2gdpx8qyk9r17977flms3qpm8zci62nd9r5wjdvr5i"; - }; - + })) + (pkgs.stdenv.mkDerivation (sources.mpv-mpris // rec { installPhase = '' install -d $out/share/mpv/scripts install -m 0644 mpris.so $out/share/mpv/scripts/${passthru.scriptName} @@ -98,7 +54,7 @@ nativeBuildInputs = with pkgs; [ pkgconfig glib mpv ]; passthru.scriptName = "mpris.so"; - }) + })) ]; }; } -- cgit v1.2.3