diff --git a/bin/default.nix b/bin/default.nix index fb171bb..21485d2 100644 --- a/bin/default.nix +++ b/bin/default.nix @@ -23,7 +23,7 @@ in lib.mapAttrs (k: f: f k) { screenshot_public = compileShell ./screenshot_public.sh (with pkgs; [ scrot xclip rsync ]); # impure - y-cal-widget = makeWrap (toString ./cal.py) "${ + y-cal-widget = makeWrap ./cal.py "${ python3.withPackages (p: [ (p.toPythonModule gcalcli) p.i3ipc ]) }/bin/python"; } diff --git a/config.nix b/config.nix index fe821b3..a3b6c14 100644 --- a/config.nix +++ b/config.nix @@ -1,5 +1,4 @@ -let sources = import ./nix/sources.nix; -in { +{ allowUnfree = true; # chromium.vaapiSupport = true; android_sdk.accept_license = true; diff --git a/default.nix b/default.nix deleted file mode 100644 index e9fdf76..0000000 --- a/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -let sources = import ./nix/sources.nix; -in import sources.nixpkgs (import ./config.nix) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a45ddd0 --- /dev/null +++ b/flake.lock @@ -0,0 +1,219 @@ +{ + "nodes": { + "blobs": { + "flake": false, + "locked": { + "lastModified": 1604995301, + "narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=", + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "type": "gitlab" + } + }, + "cachix": { + "locked": { + "lastModified": 1651571855, + "narHash": "sha256-KZie6c2J2DUPLjG2PkYSwGLvD6RygA3TxZSPQpctbNI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "fd43ce017d4c95f47166d28664a004f57458a0b1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "emacs-overlay": { + "locked": { + "lastModified": 1651640396, + "narHash": "sha256-QzqsqK9s/PYMgcUrQUqeKNv/9X5nvnQfX/h2v1fH65Q=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "43b4c2b4eaa3893266661e31bfc87e9915bebeef", + "type": "github" + }, + "original": { + "id": "emacs-overlay", + "type": "indirect" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1651652192, + "narHash": "sha256-3FUsIJ81p57rOxODRVZ+anhnVav96VWbgNA1H3Np+TY=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "267462dfb36d447421c789a3adf9d460cd09c147", + "type": "github" + }, + "original": { + "id": "home-manager", + "type": "indirect" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1650522846, + "narHash": "sha256-SxWHXRI3qJwswyXAtzsi6PKVY3KLNNnb072KaJthII8=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "6b4ebea9093c997c5f275c820e679108de4871ab", + "type": "github" + }, + "original": { + "id": "nixos-hardware", + "type": "indirect" + } + }, + "nixos-mailserver": { + "inputs": { + "blobs": "blobs", + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1652050932, + "narHash": "sha256-1lOa33Z2sC6CmNdqkCtplVHlMUWVZl4FLT6MYOM+WJQ=", + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "rev": "4396125ebbbaecbaba0f8e0afb25e492b3be5795", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "type": "gitlab" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1651558728, + "narHash": "sha256-8HzyRnWlgZluUrVFNOfZAOlA1fghpOSezXvxhalGMUo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "cbe587c735b734405f56803e267820ee1559e6c1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-mozilla": { + "locked": { + "lastModified": 1650459918, + "narHash": "sha256-sroCK+QJTmoXtcRkwZyKOP9iAYOPID2Bwdxn4GkG16w=", + "owner": "mozilla", + "repo": "nixpkgs-mozilla", + "rev": "e1f7540fc0a8b989fb8cf701dc4fd7fc76bcf168", + "type": "github" + }, + "original": { + "owner": "mozilla", + "repo": "nixpkgs-mozilla", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1645296114, + "narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-wayland": { + "inputs": { + "cachix": "cachix", + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1651650203, + "narHash": "sha256-C0wXBIcfnSMDEbCanHZJJ8VGXm0PBiFeSs4yEYwZQ1w=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "908bda3a42d3236d5ee22e2942882fa1cedf6a65", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, + "root": { + "inputs": { + "emacs-overlay": "emacs-overlay", + "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", + "nixos-mailserver": "nixos-mailserver", + "nixpkgs": "nixpkgs", + "nixpkgs-mozilla": "nixpkgs-mozilla", + "nixpkgs-stable": "nixpkgs-stable", + "nixpkgs-wayland": "nixpkgs-wayland" + } + }, + "utils": { + "locked": { + "lastModified": 1605370193, + "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5021eac20303a61fafe17224c087f5519baed54d", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..51c0ee8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "Yoricks dotfiles"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs-mozilla.url = "github:mozilla/nixpkgs-mozilla"; + emacs-overlay.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; + nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-21.05"; + nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; + nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs"; + }; + outputs = inputs@{ nixpkgs, home-manager, nixpkgs-mozilla, emacs-overlay, nixpkgs-wayland, nixpkgs-stable, nixos-hardware, self, ... }: { + overlays.default = [ + nixpkgs-wayland.overlay + nixpkgs-mozilla.overlay + emacs-overlay.overlay + (import ./fixups.nix) + (import ./pkgs) + (import ./pkgs/mdr.nix) + (import ./nixos/overlay.nix) + (final: prev: { + stable = nixpkgs-stable.legacyPackages.x86_64-linux; + flake-inputs = inputs; + }) + ]; + legacyPackages.x86_64-linux = import nixpkgs { + config = import ./config.nix; + system = "x86_64-linux"; + overlays = self.overlays.default; + }; + nixosConfigurations = self.legacyPackages.x86_64-linux.yorick.machine; + homeConfigurations.yorick = home-manager.lib.homeManagerConfiguration { + pkgs = self.legacyPackages.x86_64-linux; + configuration = import ./home-manager/home.nix; + system = "x86_64-linux"; + username = "yorick"; + stateVersion = "20.09"; + homeDirectory = "/home/yorick"; + }; + packages.x86_64-linux.yorick-home = self.homeConfigurations.yorick.activationPackage; + + }; +} diff --git a/home-manager/desktop.nix b/home-manager/desktop.nix index 208a060..6e8df18 100644 --- a/home-manager/desktop.nix +++ b/home-manager/desktop.nix @@ -1,6 +1,6 @@ { pkgs, options, ... }: let - bin = pkgs.callPackage /home/yorick/dotfiles/bin { }; + bin = pkgs.callPackage ../bin { }; fixed_slack = pkgs.slack.override { xdg-utils = pkgs.xdg-utils.overrideAttrs (o: { buildInputs = o.buildInputs ++ [ pkgs.makeWrapper ]; @@ -153,7 +153,7 @@ in { programs.firefox = { enable = true; - package = pkgs.wrapFirefox pkgs.latest.firefox-bin.unwrapped { + package = pkgs.wrapFirefox pkgs.firefox-bin.unwrapped { forceWayland = true; applicationName = "firefox"; }; diff --git a/home-manager/home-manager.nix b/home-manager/home-manager.nix deleted file mode 100644 index 1cd6f9b..0000000 --- a/home-manager/home-manager.nix +++ /dev/null @@ -1 +0,0 @@ -let pkgs = import ../.; in pkgs.yorick.home diff --git a/home-manager/home.nix b/home-manager/home.nix index 256a68a..a4b7d58 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -7,15 +7,6 @@ let } "${pkgs.thefuck}/bin/thefuck -a > $out"; in { imports = [ ./desktop.nix ./emacs.nix ./lumi.nix ]; - nixpkgs = { - config.allowUnfree = true; - inherit (import /home/yorick/dotfiles/config.nix) overlays; - }; - home = { - stateVersion = "20.09"; - username = "yorick"; - homeDirectory = "/home/yorick"; - }; programs = { starship = { enable = true; @@ -27,10 +18,7 @@ in { settings.aliases.co = "pr checkout"; }; direnv.enable = true; - home-manager = { - enable = true; - path = toString /home/yorick/dotfiles; - }; + home-manager.enable = true; git = { #lfs.enable = true; enable = true; @@ -293,11 +281,10 @@ in { #keyserver-options auto-key-retrieve ''; home.file.".mutt" = { - source = /home/yorick/dotfiles/mutt/.mutt; + source = ../mutt/.mutt; recursive = true; }; home.sessionVariables = { - HOME_MANAGER_CONFIG = - toString ./home.nix; # unused, but checked for existence + FLAKE_CONFIG_URI = "/home/yorick/dotfiles#homeConfigurations.yorick"; }; } diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index 6afd256..0000000 --- a/nix/sources.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "emacs-overlay": { - "branch": "master", - "description": "Bleeding edge emacs overlay [maintainer=@adisbladis] ", - "homepage": "", - "owner": "nix-community", - "repo": "emacs-overlay", - "rev": "43b4c2b4eaa3893266661e31bfc87e9915bebeef", - "sha256": "157bqxbvyxpqbwgp9gk7gvszznr8kr542ay5h46gdz3cmylaqfj3", - "type": "tarball", - "url": "https://github.com/nix-community/emacs-overlay/archive/43b4c2b4eaa3893266661e31bfc87e9915bebeef.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "home-manager": { - "branch": "master", - "description": "Manage a user environment using Nix [maintainer=@rycee] ", - "homepage": "https://nix-community.github.io/home-manager/", - "owner": "nix-community", - "repo": "home-manager", - "rev": "267462dfb36d447421c789a3adf9d460cd09c147", - "sha256": "0dprd5riydfhh2dmbsgxmdanfy3agrb4b0qk7gmrx9rmkwh2qmfw", - "type": "tarball", - "url": "https://github.com/nix-community/home-manager/archive/267462dfb36d447421c789a3adf9d460cd09c147.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": "945aa20cd077a8eccb1c42e29f225370b9a8d78b", - "sha256": "0qx94wvmaplagiwmrh558iwwr7nhvini40qmlx21myc66z51if32", - "type": "tarball", - "url": "https://github.com/nmattia/niv/archive/945aa20cd077a8eccb1c42e29f225370b9a8d78b.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixos-hardware": { - "branch": "master", - "description": "A collection of NixOS modules covering hardware quirks.", - "homepage": "", - "owner": "nixos", - "repo": "nixos-hardware", - "rev": "6b4ebea9093c997c5f275c820e679108de4871ab", - "sha256": "13r0c6dni2mxsgdxjd4bf9irbwp848xvgh15qcn9ra1p29fqf5ab", - "type": "tarball", - "url": "https://github.com/nixos/nixos-hardware/archive/6b4ebea9093c997c5f275c820e679108de4871ab.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixos-mailserver": { - "rev": "5675b122a947b40e551438df6a623efad19fd2e7", - "sha256": "1fwhb7a5v9c98nzhf3dyqf3a5ianqh7k50zizj8v5nmj3blxw4pi", - "type": "tarball", - "url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/5675b122a947b40e551438df6a623efad19fd2e7/nixos-mailserver-5675b122a947b40e551438df6a623efad19fd2e7.tar.gz", - "url_template": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive//nixos-mailserver-.tar.gz", - "version": "5675b122a947b40e551438df6a623efad19fd2e7" - }, - "nixos-stable": { - "branch": "nixos-21.05", - "description": "Nix Packages collection", - "homepage": "", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1", - "sha256": "11d9m0c4r4kpr3jx3cqblw6ld4d8dwcfv1lk68ipp4c87knwv7fb", - "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/530a53dcbc9437363471167a5e4762c5fcfa34a1.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs": { - "branch": "nixos-unstable", - "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", - "homepage": "https://github.com/NixOS/nixpkgs", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "cbe587c735b734405f56803e267820ee1559e6c1", - "sha256": "0jii8slqbwbvrngf9911z3al1s80v7kk8idma9p9k0d5fm3g4z7h", - "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/cbe587c735b734405f56803e267820ee1559e6c1.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs-mozilla": { - "branch": "master", - "description": "mozilla related nixpkgs (extends nixos/nixpkgs repo)", - "homepage": "", - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "rev": "e1f7540fc0a8b989fb8cf701dc4fd7fc76bcf168", - "sha256": "1b6p0rly0rywq60ks84ghc0n5zrqiafc2r64nlbnlkh9whmh5fmj", - "type": "tarball", - "url": "https://github.com/mozilla/nixpkgs-mozilla/archive/e1f7540fc0a8b989fb8cf701dc4fd7fc76bcf168.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "nixpkgs-wayland": { - "branch": "master", - "description": "Automated, pre-built packages for Wayland (sway/wlroots) tools for NixOS.", - "homepage": "", - "owner": "nix-community", - "repo": "nixpkgs-wayland", - "rev": "908bda3a42d3236d5ee22e2942882fa1cedf6a65", - "sha256": "0p2336612cnf99g221hgdmg4di9795v9r6mh241j778zhw21fk0b", - "type": "tarball", - "url": "https://github.com/nix-community/nixpkgs-wayland/archive/908bda3a42d3236d5ee22e2942882fa1cedf6a65.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - } -} diff --git a/nix/sources.nix b/nix/sources.nix deleted file mode 100644 index b54826a..0000000 --- a/nix/sources.nix +++ /dev/null @@ -1,205 +0,0 @@ -# This file has been generated by Niv. - -let - - # - # The fetchers. fetch_ fetches specs of type . - # - - fetch_file = pkgs: name: spec: - let name' = sanitizeName name + "-src"; - in if spec.builtin or true then - builtins_fetchurl { - inherit (spec) url sha256; - name = name'; - } - else - pkgs.fetchurl { - inherit (spec) url sha256; - name = name'; - }; - - fetch_tarball = pkgs: name: spec: - let name' = sanitizeName name + "-src"; - in if spec.builtin or true then - builtins_fetchTarball { - name = name'; - inherit (spec) url sha256; - } - else - pkgs.fetchzip { - name = name'; - inherit (spec) url sha256; - }; - - fetch_git = name: spec: - let - ref = if spec ? ref then - spec.ref - else if spec ? branch then - "refs/heads/${spec.branch}" - else if spec ? tag then - "refs/tags/${spec.tag}" - else - abort - "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; - in builtins.fetchGit { - url = spec.repo; - inherit (spec) rev; - inherit ref; - }; - - fetch_local = spec: spec.path; - - fetch_builtin-tarball = name: - throw '' - [${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=tarball -a builtin=true''; - - fetch_builtin-url = name: - throw '' - [${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. - $ niv modify ${name} -a type=file -a builtin=true''; - - # - # Various helpers - # - - # https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695 - sanitizeName = name: - (concatMapStrings (s: if builtins.isList s then "-" else s) - (builtins.split "[^[:alnum:]+._?=-]+" - ((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name))); - - # The set of packages used when specs are fetched using non-builtins. - mkPkgs = sources: system: - let - sourcesNixpkgs = import - (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { - inherit system; - }; - 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: - - if !builtins.hasAttr "type" spec then - abort "ERROR: niv spec ${name} does not have a 'type' attribute" - else if spec.type == "file" then - fetch_file pkgs name spec - else if spec.type == "tarball" then - fetch_tarball pkgs name spec - else if spec.type == "git" then - fetch_git name spec - else if spec.type == "local" then - fetch_local spec - else if spec.type == "builtin-tarball" then - fetch_builtin-tarball name - else if spec.type == "builtin-url" then - fetch_builtin-url name - else - abort - "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; - - # If the environment variable NIV_OVERRIDE_${name} is set, then use - # the path directly as opposed to the fetched source. - replace = name: drv: - let - saneName = stringAsChars - (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; - ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; - in if ersatz == "" then - drv - else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then - /. + ersatz - else - /. + builtins.getEnv "PWD" + "/${ersatz}"; - - # Ports of functions for older nix versions - - # a Nix version of mapAttrs if the built-in doesn't exist - mapAttrs = builtins.mapAttrs or (f: set: - with builtins; - listToAttrs (map (attr: { - name = attr; - value = f attr set.${attr}; - }) (attrNames set))); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: - if first > last then - [ ] - else - builtins.genList (n: first + n) (last - first + 1); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 - stringToCharacters = s: - map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); - - # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 - stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); - concatMapStrings = f: list: concatStrings (map f list); - concatStrings = builtins.concatStringsSep ""; - - # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else { }; - - # fetchTarball version that is compatible between all the versions of Nix - builtins_fetchTarball = { url, name ? null, sha256 }@attrs: - let inherit (builtins) lessThan nixVersion fetchTarball; - in if lessThan nixVersion "1.12" then - fetchTarball - ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; - - # fetchurl version that is compatible between all the versions of Nix - builtins_fetchurl = { url, name ? null, sha256 }@attrs: - let inherit (builtins) lessThan nixVersion fetchurl; - in if lessThan nixVersion "1.12" then - fetchurl - ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; - - # Create the final "sources" from the config - mkSources = config: - mapAttrs (name: spec: - if builtins.hasAttr "outPath" spec then - abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); }) - config.sources; - - # The "config" used by the fetchers - mkConfig = { sourcesFile ? - if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then - { } - else - builtins.fromJSON (builtins.readFile sourcesFile) - , system ? builtins.currentSystem, pkgs ? mkPkgs sources system }: rec { - # The sources, i.e. the attribute set of spec name to spec - inherit sources; - - # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers - inherit pkgs; - }; - -in mkSources (mkConfig { }) // { - __functor = _: settings: mkSources (mkConfig settings); -} diff --git a/nixos/logical/zazu.nix b/nixos/logical/zazu.nix index ca99c48..42df95a 100644 --- a/nixos/logical/zazu.nix +++ b/nixos/logical/zazu.nix @@ -1,13 +1,12 @@ # Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page and in the NixOS manual (accessible by running ‘nixos-help’). -let sources = import ../../nix/sources.nix; -in { config, lib, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: { imports = [ # Include the results of the hardware scan. ../physical/apu2c4.nix # ../roles - "${sources.nixos-hardware}/pcengines/apu" + inputs.nixos-hardware.nixosModules.pcengines-apu ]; diff --git a/nixos/modules/muflax-blog.nix b/nixos/modules/muflax-blog.nix index eeed725..53d07e1 100644 --- a/nixos/modules/muflax-blog.nix +++ b/nixos/modules/muflax-blog.nix @@ -1,4 +1,4 @@ -{ cur_pkgs, config, lib, ... }: +{ pkgs, config, lib, ... }: let cfg = config.services.muflax-blog; @@ -11,7 +11,7 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/78e9665b48ff45d3e29f45b3ebeb6fc6c6e19922.tar.gz"; sha256 = "09f50jaijvry9lrnx891qmcf92yb8qs64n1cvy0db2yjrmxsxyw8"; - }) { system = builtins.currentSystem; }; + }) { system = pkgs.stdenv.system; }; blog = lib.overrideDerivation (nixpkgs.callPackage "${muflax-source}/maintenance" { }) (default: { buildPhase = default.buildPhase + "\n" + '' diff --git a/nixos/overlay.nix b/nixos/overlay.nix index cac1450..cc18ad6 100644 --- a/nixos/overlay.nix +++ b/nixos/overlay.nix @@ -5,6 +5,7 @@ in pkgs: super: { let c = import (pkgs.path + "/nixos/lib/eval-config.nix") { inherit (pkgs.stdenv.hostPlatform) system; + specialArgs.inputs = pkgs.flake-inputs; modules = [ ({ lib, ... }: { config.nixpkgs.pkgs = lib.mkDefault pkgs; diff --git a/nixos/physical/3950x.nix b/nixos/physical/3950x.nix index 3fa937c..dddec1c 100644 --- a/nixos/physical/3950x.nix +++ b/nixos/physical/3950x.nix @@ -1,8 +1,8 @@ -{ config, pkgs, lib, ... }: -let sources = import ../../nix/sources.nix; -in { +{ config, pkgs, lib, inputs, ... }: +{ imports = [ ./. + inputs.nixos-hardware.nixosModules.common-cpu-amd; ./3950x-hardware-config.nix "${sources.nixos-hardware}/common/cpu/amd" ]; diff --git a/nixos/physical/fractal.nix b/nixos/physical/fractal.nix index 795af36..25114d7 100644 --- a/nixos/physical/fractal.nix +++ b/nixos/physical/fractal.nix @@ -1,7 +1,6 @@ -{ config, lib, pkgs, ... }: -let sources = import ../../nix/sources.nix; -in { - imports = [ ./. "${sources.nixos-hardware}/common/cpu/intel" ]; +{ config, lib, pkgs, inputs, ... }: +{ + imports = [ ./. inputs.nixos-hardware.nixosModules.common-cpu-intel ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" ]; diff --git a/nixos/physical/nuc.nix b/nixos/physical/nuc.nix index 411ba84..7140247 100644 --- a/nixos/physical/nuc.nix +++ b/nixos/physical/nuc.nix @@ -1,11 +1,9 @@ -{ config, lib, pkgs, modulesPath, ... }: -let sources = import ../../nix/sources.nix; -in { - +{ config, lib, pkgs, inputs, modulesPath, ... }: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ./. - "${sources.nixos-hardware}/common/cpu/intel" + inputs.nixos-hardware.nixosModules.common-cpu-intel ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; diff --git a/nixos/physical/x11.nix b/nixos/physical/x11.nix index 3fb2eb7..dfd0fa4 100644 --- a/nixos/physical/x11.nix +++ b/nixos/physical/x11.nix @@ -1,9 +1,8 @@ -{ config, pkgs, lib, ... }: -let sources = import ../../nix/sources.nix; -in { +{ config, pkgs, lib, inputs, ... }: +{ imports = [ ./. - "${sources.nixos-hardware}/lenovo/thinkpad/x1" + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1 ./x11-hardware-config.nix ]; diff --git a/nixos/physical/xps9360.nix b/nixos/physical/xps9360.nix index faa7906..87dbf2d 100644 --- a/nixos/physical/xps9360.nix +++ b/nixos/physical/xps9360.nix @@ -1,8 +1,7 @@ -{ config, lib, pkgs, ... }: -let sources = import ../../nix/sources.nix; -in { +{ config, lib, pkgs, inputs, ... }: +{ imports = [ - "${sources.nixos-hardware}/dell/xps/13-9360" + inputs.nixos-hardware.nixosModules.dell-xps-13-9360; ./xps9360-hardware-config.nix ]; diff --git a/nixos/services/email.nix b/nixos/services/email.nix index 9a524ab..a153f1a 100644 --- a/nixos/services/email.nix +++ b/nixos/services/email.nix @@ -1,7 +1,6 @@ -{ config, pkgs, lib, ... }: -let sources = import ../../nix/sources.nix; -in { - imports = [ ("${sources.nixos-mailserver}") ]; +{ config, pkgs, lib, inputs, ... }: +{ + imports = [ inputs.nixos-mailserver.nixosModule ]; mailserver = rec { enable = true; diff --git a/nixos/services/muflax-church.nix b/nixos/services/muflax-church.nix index e383050..5eb3395 100644 --- a/nixos/services/muflax-church.nix +++ b/nixos/services/muflax-church.nix @@ -10,7 +10,7 @@ let url = "https://github.com/NixOS/nixpkgs-channels/archive/78e9665b48ff45d3e29f45b3ebeb6fc6c6e19922.tar.gz"; sha256 = "09f50jaijvry9lrnx891qmcf92yb8qs64n1cvy0db2yjrmxsxyw8"; - }) { system = builtins.currentSystem; }; + }) { system = pkgs.stdenv.system; }; muflax-church = (nixpkgs.callPackage "${muflax-source}/maintenance" { }).overrideDerivation (default: { diff --git a/overlay.nix b/overlay.nix deleted file mode 100644 index 1cd9a22..0000000 --- a/overlay.nix +++ /dev/null @@ -1,10 +0,0 @@ -let sources = import ./nix/sources.nix; -in pkgs: super: { - yorick = super.yorick // rec { - home = { check ? true, newsReadIdsFile ? null }: - import "${sources.home-manager}/home-manager/home-manager.nix" { - confPath = ./home-manager/home.nix; - inherit pkgs check newsReadIdsFile; - }; - }; -} diff --git a/overlays.nix b/overlays.nix deleted file mode 100644 index fe6ae6e..0000000 --- a/overlays.nix +++ /dev/null @@ -1,11 +0,0 @@ -let sources = import ./nix/sources.nix; -in [ - (import ./fixups.nix) - (import "${sources.nixpkgs-wayland}/overlay.nix") - (import sources.nixpkgs-mozilla) - (import sources.emacs-overlay) - (import ./pkgs) - (import ./pkgs/mdr.nix) - (import ./nixos/overlay.nix) - (import ./overlay.nix) -] diff --git a/pkgs/default.nix b/pkgs/default.nix index ea5116a..7dc6c94 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -3,7 +3,8 @@ yori-cc = super.callPackage ./yori-cc.nix { }; ftb = super.callPackage ./ftb.nix {}; - pyroscope = (import (import ../nix/sources.nix).nixos-stable {}).callPackage ./pyroscope {}; # TODO: update this + # todo: python 2 -> 3 + pyroscope = self.stable.callPackage ./pyroscope {}; yscripts = super.callPackage ../bin {}; factorio = super.factorio.override {