From 70d6989e9b86c7650026688eade7fcc2c7f407c4 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Sat, 29 Feb 2020 22:30:53 +0100 Subject: [PATCH] Remove cachix deps and niv uses --- cachix/cachix.nix | 8 -------- cachix/nixfmt.nix | 8 -------- nix/sources.json | 48 ++++++++++++----------------------------------- nix/sources.nix | 36 ++++++++++++++++------------------- pkgs/default.nix | 8 ++++---- 5 files changed, 32 insertions(+), 76 deletions(-) delete mode 100644 cachix/cachix.nix delete mode 100644 cachix/nixfmt.nix diff --git a/cachix/cachix.nix b/cachix/cachix.nix deleted file mode 100644 index f3d9650f..00000000 --- a/cachix/cachix.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - nix = { - binaryCaches = [ "https://cachix.cachix.org" ]; - binaryCachePublicKeys = - [ "cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=" ]; - trustedUsers = [ "root" "maralorn" ]; - }; -} diff --git a/cachix/nixfmt.nix b/cachix/nixfmt.nix deleted file mode 100644 index b0a446b6..00000000 --- a/cachix/nixfmt.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - nix = { - binaryCaches = [ "https://nixfmt.cachix.org" ]; - binaryCachePublicKeys = - [ "nixfmt.cachix.org-1:uyEQg16IhCFeDpFV07aL+Dbmh18XHVUqpkk/35WAgJI=" ]; - trustedUsers = [ "root" "maralorn" ]; - }; -} diff --git a/nix/sources.json b/nix/sources.json index 50a7c7ec..71fff648 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -11,18 +11,6 @@ "url": "https://github.com/andir/ate/archive/49846b79606a3b69f3ca5c98d4776ef34a76dcf8.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, - "cachix": { - "branch": "master", - "description": "Command line client for Nix binary cache hosting:", - "homepage": "https://cachix.org", - "owner": "cachix", - "repo": "cachix", - "rev": "66f4e37314b39356964ae160bfc5a9dc7880a6b2", - "sha256": "090h7jkk06j97jaw5yiwn88izn972784nr1qmhxfkzrqw3912n7f", - "type": "tarball", - "url": "https://github.com/cachix/cachix/archive/66f4e37314b39356964ae160bfc5a9dc7880a6b2.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, "ghcide": { "branch": "master", "description": "Nix installation for ghcide", @@ -71,30 +59,6 @@ "url": "https://github.com/target/lorri/archive/73665b9644ea96427ae6f881a52cf8b10d129f5d.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, - "niv": { - "branch": "master", - "description": "Easy dependency management for Nix projects", - "homepage": "https://github.com/nmattia/niv", - "owner": "nmattia", - "repo": "niv", - "rev": "98c74a80934123cb4c3bf3314567f67311eb711a", - "sha256": "1w8n54hapd4x9f1am33icvngkqns7m3hl9yair38yqq08ffwg0kn", - "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/98c74a80934123cb4c3bf3314567f67311eb711a.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixfmt": { - "branch": "master", - "description": "A formatter for Nix code", - "homepage": "https://nixfmt.serokell.io", - "owner": "serokell", - "repo": "nixfmt", - "rev": "eeab5dff80190b57f90da5682a47e3e977724003", - "sha256": "1sjkmi301lw6wpns30xz5gmm2mf24srxz86nkmi16y7bryybkq4y", - "type": "tarball", - "url": "https://github.com/serokell/nixfmt/archive/eeab5dff80190b57f90da5682a47e3e977724003.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, "nixos-hardware": { "branch": "master", "description": "A collection of NixOS modules covering hardware quirks.", @@ -131,6 +95,18 @@ "url": "https://github.com/NixOS/nixpkgs-channels/archive/ce9f1aaa39ee2a5b76a9c9580c859a74de65ead5.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "obelisk": { + "branch": "master", + "description": "Obelisk provides an easy way to develop and deploy your Reflex project for web and mobile", + "homepage": "", + "owner": "obsidiansystems", + "repo": "obelisk", + "rev": "0133449c597afdb3d4aaeb7a6475610b7bca6c99", + "sha256": "0p8m58b461529rmhmn95ndddgh5b256p6i5b4iyhzsr9kmyjlsmv", + "type": "tarball", + "url": "https://github.com/obsidiansystems/obelisk/archive/0133449c597afdb3d4aaeb7a6475610b7bca6c99.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "tabnine-vim": { "branch": "master", "description": "Vim client for TabNine", diff --git a/nix/sources.nix b/nix/sources.nix index 6e2bf231..8a725cb4 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -49,26 +49,22 @@ let # The set of packages used when specs are fetched using non-builtins. mkPkgs = sources: - if hasNixpkgsPath - then - if hasThisAsNixpkgsPath - then import (builtins_fetchTarball { inherit (mkNixpkgs sources) url sha256; }) {} - else import {} - else - import (builtins_fetchTarball { inherit (mkNixpkgs sources) url sha256; }) {}; - - mkNixpkgs = sources: - if builtins.hasAttr "nixpkgs" sources - then sources.nixpkgs - else abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; - - hasNixpkgsPath = (builtins.tryEval ).success; - hasThisAsNixpkgsPath = - (builtins.tryEval ).success && == ./.; + let + sourcesNixpkgs = + import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {}; + hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; + hasThisAsNixpkgsPath = == ./.; + in + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import {} + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; # The actual fetching function. fetch = pkgs: name: spec: diff --git a/pkgs/default.nix b/pkgs/default.nix index 9e396641..915613de 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -67,7 +67,7 @@ in rec { home-neovim = (import ./nvim) neovim; - niv = (import sources.niv { }).niv; + niv = unstable.niv; # pkgs assumed to be present on a non nixos host core-system-pkgs = { @@ -152,7 +152,6 @@ in rec { runScript = "${gw2wrapper}/bin/gw2wrapper"; }; discord = unfreePkgs.discord; - cachix = import sources.cachix; inherit (pkgs.gnome3) nautilus; inherit (pkgs.xorg) xev xbacklight; inherit (pkgs.gitAndTools) hub; @@ -164,6 +163,8 @@ in rec { anki + cachix + # communication signal-desktop tdesktop acpi dino mumble @@ -217,10 +218,9 @@ in rec { }; home-pkgs = { - nixfmt = import sources.nixfmt { }; inherit (pkgs.pythonPackages) yapf jsbeautifier; inherit (pkgs) - mpc_cli ncmpcpp shfmt htmlTidy astyle nodejs tasksh magic-wormhole; + mpc_cli ncmpcpp shfmt htmlTidy astyle nodejs tasksh magic-wormhole nixfmt; inherit (my-lib) ghc; inherit home-neovim ghcide; cabal-fmt = (unBreak unstable.haskell.packages.ghc881.cabal-fmt);