diff --git a/flake.nix b/flake.nix index 9fbfa07b..c4657906 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,5 @@ { description = "maralorns configuration"; - nixConfig = { - allow-import-from-derivation = true; - }; inputs = { secrets = { diff --git a/home-manager/roles/mode-switching.nix b/home-manager/roles/mode-switching.nix index d926f0ba..e14eaf36 100644 --- a/home-manager/roles/mode-switching.nix +++ b/home-manager/roles/mode-switching.nix @@ -18,7 +18,7 @@ in { echo "Running update-modes …" ${updateModes}/bin/update-modes echo "Updating system …" - ${pkgs.nix-output-monitor}/bin/nom build --builders @$(builders-configurator) $(readlink -f /etc/nixos)#nixosConfigurations.$(hostname).config.system.build.toplevel --allow-import-from-derivation --no-link + ${pkgs.nix-output-monitor}/bin/nom build --builders @$(builders-configurator) $(readlink -f /etc/nixos)#nixosConfigurations.$(hostname).config.system.build.toplevel --no-link /run/wrappers/bin/sudo -A /run/current-system/sw/bin/nixos-rebuild switch echo "Maintenance finished." ''; @@ -59,7 +59,7 @@ in { mode <- getMode say [i|Quick switching to mode #{mode} ...|] builders <- builders_configurator |> captureTrim - path :: Text <- decodeUtf8 <$> (nom ["build", "--builders", [i|@#{builders}|], "--allow-import-from-derivation", "--print-out-paths", "--no-link", [i|/home/maralorn/git/config\#homeConfigurations.${hostName}-#{mode}.activationPackage|]] |> captureTrim) + path :: Text <- decodeUtf8 <$> (nom ["build", "--builders", [i|@#{builders}|], "--print-out-paths", "--no-link", [i|/home/maralorn/git/config\#homeConfigurations.${hostName}-#{mode}.activationPackage|]] |> captureTrim) exe ([i|#{path}/activate|] :: String) update_modes ''; diff --git a/home-manager/roles/state.nix b/home-manager/roles/state.nix index 0a10405d..3cea007f 100644 --- a/home-manager/roles/state.nix +++ b/home-manager/roles/state.nix @@ -15,7 +15,6 @@ defaultMode: { ".config/Signal" ".config/discord" ".config/gh" - ".config/VSCodium/User" ".contacts" ".gnupg" ".config/mpv/watch_later" @@ -57,7 +56,6 @@ in { ++ [ (mkLine "L+" "${home}/.password-store" "git/password-store") (mkLine "L+" "${home}/.volatile" "/disk/volatile/maralorn") - (mkLine "L+" "${home}/.config/nixpkgs/home.nix" "${home}/git/config/home.nix") (mkLine "L+" "${home}/.persist" "/disk/persist/maralorn") (mkLine "f" "${home}/.mode" defaultMode) (mkLine "f" "${home}/.config/lazygit/state.yml" "startuppopupversion: 5") diff --git a/packages/builders-configurator/default.nix b/packages/builders-configurator/default.nix new file mode 100644 index 00000000..7e7f8c04 --- /dev/null +++ b/packages/builders-configurator/default.nix @@ -0,0 +1,35 @@ +{ + mkDerivation, + base, + containers, + effectful, + effectful-th, + lib, + relude, + say, + shh, + string-interpolate, + text, + witch, +}: +mkDerivation { + pname = "builders-configurator"; + version = "0.1.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + base + containers + effectful + effectful-th + relude + say + shh + string-interpolate + text + witch + ]; + license = lib.licenses.agpl3Plus; + mainProgram = "builders-configurator"; +} diff --git a/packages/flake-module.nix b/packages/flake-module.nix index 85e441ba..c26eed1f 100644 --- a/packages/flake-module.nix +++ b/packages/flake-module.nix @@ -4,22 +4,36 @@ ... }: let pkgs = inputs.nixos-unstable.legacyPackages.x86_64-linux; - inherit (pkgs.haskell.lib.compose) appendPatch; + inherit (pkgs.haskell.lib.compose) appendPatch overrideCabal; includePatterns = [ ".hs" ".cabal" "LICENSE" + "default.nix" "CHANGELOG.md" ]; cleanCabalPackage = { name, source, extraPatterns ? [], - }: hpkgs: - lib.pipe source + }: hpkgs: let + cleanSource = lib.sourceFilesBySuffices source (includePatterns ++ extraPatterns); + in + lib.pipe {} [ - (src: lib.sourceFilesBySuffices src (includePatterns ++ extraPatterns)) - (src: hpkgs.callCabal2nix name src {}) + (hpkgs.callPackage source) + (overrideCabal ( + old: { + src = cleanSource; + preConfigure = '' + echo "Checking that default.nix is up-to-date." + ${hpkgs.cabal2nix}/bin/cabal2nix . > fresh-default.nix + cp ${cleanSource}/default.nix . + ${pkgs.alejandra}/bin/alejandra -q fresh-default.nix default.nix + ${pkgs.diffutils}/bin/diff -w default.nix fresh-default.nix + ''; + } + )) hpkgs.buildFromCabalSdist ]; haskellPackagesOverlay = final: prev: diff --git a/packages/kassandra/kassandra/default.nix b/packages/kassandra/kassandra/default.nix new file mode 100644 index 00000000..1fc1bb59 --- /dev/null +++ b/packages/kassandra/kassandra/default.nix @@ -0,0 +1,76 @@ +{ + mkDerivation, + aeson, + ansi-terminal, + async, + base, + clay, + containers, + data-default-class, + extra, + generic-optics, + jsaddle, + jsaddle-dom, + lib, + nonempty-containers, + optics, + optics-th, + password, + patch, + process, + reflex, + reflex-dom, + relude, + say, + scientific, + stm, + string-interpolate, + taskwarrior, + template-haskell, + text, + these, + time, + unordered-containers, + uuid, + witherable, +}: +mkDerivation { + pname = "kassandra"; + version = "0.1.0.0"; + src = ./.; + libraryHaskellDepends = [ + aeson + ansi-terminal + async + base + clay + containers + data-default-class + extra + generic-optics + jsaddle + jsaddle-dom + nonempty-containers + optics + optics-th + password + patch + process + reflex + reflex-dom + relude + say + scientific + stm + string-interpolate + taskwarrior + template-haskell + text + these + time + unordered-containers + uuid + witherable + ]; + license = "unknown"; +} diff --git a/packages/kassandra/standalone/default.nix b/packages/kassandra/standalone/default.nix new file mode 100644 index 00000000..1c4e3150 --- /dev/null +++ b/packages/kassandra/standalone/default.nix @@ -0,0 +1,78 @@ +{ + mkDerivation, + aeson, + base, + bytestring, + containers, + data-default, + deferred-folds, + dhall, + directory, + either, + filepath, + filepattern, + iCalendar, + kassandra, + lib, + network-simple, + nonempty-containers, + password, + paths, + reflex, + reflex-dom, + relude, + say, + stm, + stm-containers, + streamly, + streamly-bytestring, + taskwarrior, + text, + time, + tz, + unix, + uuid, +}: +mkDerivation { + pname = "standalone"; + version = "0.1.0.0"; + src = ./.; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + aeson + base + bytestring + containers + data-default + deferred-folds + dhall + directory + either + filepath + filepattern + iCalendar + kassandra + network-simple + nonempty-containers + password + paths + reflex + reflex-dom + relude + say + stm + stm-containers + streamly + streamly-bytestring + taskwarrior + text + time + tz + unix + uuid + ]; + executableHaskellDepends = [base kassandra]; + license = "unknown"; + mainProgram = "kassandra2"; +} diff --git a/packages/nixpkgs-bot/default.nix b/packages/nixpkgs-bot/default.nix new file mode 100644 index 00000000..ff2857f4 --- /dev/null +++ b/packages/nixpkgs-bot/default.nix @@ -0,0 +1,79 @@ +{ + mkDerivation, + aeson-schemas, + async, + base, + clock, + containers, + esqueleto, + exceptions, + graphql-client, + http-client, + lib, + matrix-client, + monad-logger, + mtl, + persistent, + persistent-sqlite, + random, + relude, + resourcet, + time, + typed-process, + yaml, +}: +mkDerivation { + pname = "nixpkgs-bot"; + version = "0.1.0.0"; + src = ./.; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + aeson-schemas + async + base + clock + containers + esqueleto + exceptions + graphql-client + http-client + matrix-client + monad-logger + mtl + persistent + persistent-sqlite + random + relude + resourcet + time + typed-process + yaml + ]; + executableHaskellDepends = [ + aeson-schemas + async + base + clock + containers + esqueleto + exceptions + graphql-client + http-client + matrix-client + monad-logger + mtl + persistent + persistent-sqlite + random + relude + resourcet + time + typed-process + yaml + ]; + homepage = "https://git.maralorn.de/nixpkgs-bot"; + description = "A matrix bot which watches nixpkgs and informs about PR progress"; + license = lib.licenses.agpl3Plus; + mainProgram = "nixpkgs-bot"; +} diff --git a/packages/rssfeeds/default.nix b/packages/rssfeeds/default.nix new file mode 100644 index 00000000..53238445 --- /dev/null +++ b/packages/rssfeeds/default.nix @@ -0,0 +1,52 @@ +{ + mkDerivation, + base, + containers, + errors, + exceptions, + extra, + feed, + filepattern, + lens, + lib, + megaparsec, + notmuch, + optparse-applicative, + purebred-email, + relude, + say, + string-interpolate, + tagsoup, + text, + time, + witch, +}: +mkDerivation { + pname = "rssfeeds"; + version = "0.1.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + base + containers + errors + exceptions + extra + feed + filepattern + lens + megaparsec + notmuch + optparse-applicative + purebred-email + relude + say + string-interpolate + tagsoup + text + time + witch + ]; + license = "unknown"; +} diff --git a/packages/wizards-dialog/.envrc b/packages/wizards-dialog/.envrc deleted file mode 100644 index 3550a30f..00000000 --- a/packages/wizards-dialog/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/packages/wizards-dialog/default.nix b/packages/wizards-dialog/default.nix new file mode 100644 index 00000000..41e528e3 --- /dev/null +++ b/packages/wizards-dialog/default.nix @@ -0,0 +1,47 @@ +{ + mkDerivation, + aeson, + ansi-terminal, + base, + daemons, + haskeline, + lib, + process, + relude, + text, + witch, + wizards, + yaml, +}: +mkDerivation { + pname = "wizards-dialog"; + version = "0.1.0.0"; + src = ./.; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + ansi-terminal + base + haskeline + process + relude + text + witch + wizards + ]; + executableHaskellDepends = [ + aeson + ansi-terminal + base + daemons + haskeline + process + relude + text + witch + wizards + yaml + ]; + license = "AGPL"; + mainProgram = "hotkeys"; +}