commit 5ea8f3d3a4482508f2b7dac68d5801d21df783fd
parent c6fa40a41511a9f8c02f983cecd60baff7f412ca
Author: Vincent Demeester <vincent@sbr.pm>
Date: Wed, 2 Dec 2020 17:53:17 +0100
nix: bootstrapping a flake 😛
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
M | .envrc | | | 2 | ++ |
A | flake.lock | | | 153 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | flake.nix | | | 121 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | nix/config.nix | | | 4 | ++++ |
M | shell.nix | | | 6 | +++++- |
5 files changed, 285 insertions(+), 1 deletion(-)
diff --git a/.envrc b/.envrc
@@ -1,4 +1,6 @@
# use_nix shell.nix
+watch_file nix/sources.json
+
test -f .secrets && source .secrets || echo "no secrets"
export QEMU_OPTS="-m 8096 -cpu host"
export PATH="${PWD}/bin:${PATH}"
diff --git a/flake.lock b/flake.lock
@@ -0,0 +1,153 @@
+{
+ "nodes": {
+ "emacs": {
+ "locked": {
+ "lastModified": 1606738807,
+ "narHash": "sha256-OLUutatHIVeJiAdeS7LQuGHet5k2v82ciJXgMKvpPw0=",
+ "owner": "nix-community",
+ "repo": "emacs-overlay",
+ "rev": "bd8cca365ef9584106670363afa90b6e02720087",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "ref": "master",
+ "repo": "emacs-overlay",
+ "type": "github"
+ }
+ },
+ "gitignore-nix": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1594969032,
+ "narHash": "sha256-nbZfz02QoVe1yYK7EtCV7wMi4VdHzZEoPg20ZSDo9to=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "c4662e662462e7bf3c2a968483478a665d00e717",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "ref": "master",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
+ "home-manager": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1606691558,
+ "narHash": "sha256-mkLAmBhiQ7kI7Ezw1ken3ymGolBmEfiO881iFWSGrbg=",
+ "owner": "rycee",
+ "repo": "home-manager",
+ "rev": "c1faa848c5224452660cd6d2e0f4bd3e8d206419",
+ "type": "github"
+ },
+ "original": {
+ "owner": "rycee",
+ "ref": "master",
+ "repo": "home-manager",
+ "type": "github"
+ }
+ },
+ "nixos": {
+ "locked": {
+ "lastModified": 1606669556,
+ "narHash": "sha256-9rlqZ5JwnA6nK04vKhV0s5ndepnWL5hpkaTV1b4ASvk=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "ae47c79479a086e96e2977c61e538881913c0c08",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-20.09",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixos-hardware": {
+ "locked": {
+ "lastModified": 1606379629,
+ "narHash": "sha256-Km8fqZnhve84HBue9FdGdpXjG2eR8YCJQp1lZstaGRs=",
+ "owner": "NixOS",
+ "repo": "nixos-hardware",
+ "rev": "abfae8841bcf6368c89366a100232e05d676e114",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "master",
+ "repo": "nixos-hardware",
+ "type": "github"
+ }
+ },
+ "nixos-unstable": {
+ "locked": {
+ "lastModified": 1606655114,
+ "narHash": "sha256-sCOycaZWoucJ15RTE31YkNnxAOUWgVO/i/0a9DkACxE=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "8ee7c2505f9e7019aa69c8a6313e5f2d32a69f27",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1606752572,
+ "narHash": "sha256-8Vn/kxxjdupAAdSXePaMN71hfUHtRnPntcU7F/oOxs4=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "ee1a1f8c89cbbf514b4ddd441bf8557f63ab6e3b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "master",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nyxt": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1606644049,
+ "narHash": "sha256-eaPvSQ7SRK/4uk7wcTgyYW1OyNBIkbNbokvRNATwDUA=",
+ "owner": "atlas-engineer",
+ "repo": "nyxt",
+ "rev": "48407b36a55075456eec78bb41c36f91c1765cac",
+ "type": "github"
+ },
+ "original": {
+ "owner": "atlas-engineer",
+ "ref": "master",
+ "repo": "nyxt",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "emacs": "emacs",
+ "gitignore-nix": "gitignore-nix",
+ "home-manager": "home-manager",
+ "nixos": "nixos",
+ "nixos-hardware": "nixos-hardware",
+ "nixos-unstable": "nixos-unstable",
+ "nixpkgs": "nixpkgs",
+ "nyxt": "nyxt"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
@@ -0,0 +1,121 @@
+# flake.nix --- the heart of my home
+#
+{
+ description = ''
+ home is the personal mono-repo of Vincent Demeester; containing the declarative configuration of
+ servers, desktops, laptops - including dotfiles; a collection of packages; sources of several
+ websites like vincent.demeester.fr, …
+ '';
+
+ inputs = {
+ nixpkgs = {
+ type = "github";
+ owner = "NixOS";
+ repo = "nixpkgs";
+ ref = "master";
+ };
+ nixos = {
+ type = "github";
+ owner = "NixOS";
+ repo = "nixpkgs";
+ ref = "nixos-20.09";
+ };
+ nixos-unstable = {
+ type = "github";
+ owner = "NixOS";
+ repo = "nixpkgs";
+ ref = "nixos-unstable";
+ };
+ nixos-hardware = {
+ type = "github";
+ owner = "NixOS";
+ repo = "nixos-hardware";
+ ref = "master";
+ };
+ # nix-darwin = {
+ # type = "github";
+ # owner = "LnL7";
+ # repo = "nix-darwin";
+ # ref = "master";
+ # };
+ home-manager = {
+ type = "github";
+ owner = "rycee";
+ repo = "home-manager";
+ ref = "master";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ emacs = {
+ type = "github";
+ owner = "nix-community";
+ repo = "emacs-overlay";
+ ref = "master";
+ };
+ gitignore-nix = {
+ type = "github";
+ owner = "hercules-ci";
+ repo = "gitignore.nix";
+ ref = "master";
+ flake = false;
+ };
+ nyxt = {
+ type = "github";
+ owner = "atlas-engineer";
+ repo = "nyxt";
+ ref = "master";
+ flake = false;
+ };
+ };
+
+ outputs = { self, ... } @ inputs:
+ with inputs.nixpkgs.lib;
+ let
+ forEachSystem = genAttrs [ "x86_64-linux" "aarch64-linux" ];
+ pkgsBySystem = forEachSystem
+ (system:
+ import inputs.nixpkgs {
+ inherit system;
+ config = import ./nix/config.nix;
+ overlays = self.internal.overlays."${system}";
+ }
+ );
+ in
+ {
+ # `internal` isn't a known output attribute for flakes. It is used here to contain
+ # anything that isn't meant to be re-usable.
+ # Taken from davidtwco/veritas repository :)
+ internal = { };
+
+ # Attribute set of hostnames to be evaluated as NixOS configurations. Consumed by
+ # `nixos-rebuild` on those hosts.
+ nixosConfigurations = { };
+
+ # Import the modules exported by this flake.
+ nixosModules = { };
+
+ # Expose a dev shell which contains tools for working on this repository.
+ devShell = { };
+
+ # Expose an overlay which provides the packages defined by this repository.
+ #
+ # Overlays are used more widely in this repository, but often for modifying upstream packages
+ # or making third-party packages easier to access - it doesn't make sense to share those,
+ # so they in the flake output `internal.overlays`.
+ #
+ # These are meant to be consumed by other projects that might import this flake.
+ overlay = { };
+
+ # Expose the packages defined in this flake, built for any supported systems. These are
+ # meant to be consumed by other projects that might import this flake.
+ packages = forEachSystem (system:
+ let
+ pkgs = pkgsBySystem."${system}";
+ in
+ {
+ ape = pkgs.callPackage ./pkgs/ape { };
+ });
+
+ # defaultPackage.x86_64-linux = self.packages.x86_64-linux.hello;
+
+ };
+}
diff --git a/nix/config.nix b/nix/config.nix
@@ -0,0 +1,4 @@
+{
+ allowUnfree = true;
+ allowBroken = true;
+}
diff --git a/shell.nix b/shell.nix
@@ -4,7 +4,8 @@ let
nixos-unstable = sources.pkgs-unstable { };
nixos = sources.pkgs { };
in
-pkgs.mkShell {
+pkgs.mkShell
+{
name = "nix-config";
buildInputs = with pkgs; [
cachix
@@ -16,3 +17,6 @@ pkgs.mkShell {
export NIX_PATH="nixpkgs=${pkgs.path}:nixos=${nixos.path}:nixos-unstable=${nixos-unstable.path}"
'';
}
+# (import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
+# src = builtins.fetchGit ./.;
+#}).shellNix