From ea4e1c3cc31fb7691e63fbf5725c0ffbc25415e5 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Thu, 2 Jun 2022 03:32:14 +0200 Subject: [PATCH] init flake --- flake.lock | 103 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 29 +++++++++++++ machines/laptop.nix | 15 ++++++- 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7dba984 --- /dev/null +++ b/flake.lock @@ -0,0 +1,103 @@ +{ + "nodes": { + "dan": { + "inputs": { + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1654132489, + "narHash": "sha256-7L6gKN5Y2PbjK2aHX2jwOCZfe9R+7RusvuULy9EbKGs=", + "ref": "master", + "rev": "9b6f60ce8a94d8269190dbe4ac9450f87910ac8b", + "revCount": 159, + "type": "git", + "url": "https://git.dodsorf.as/Dandellion/NUR" + }, + "original": { + "type": "git", + "url": "https://git.dodsorf.as/Dandellion/NUR" + } + }, + "home-manager-2205": { + "inputs": { + "nixpkgs": [ + "nixos-2205" + ] + }, + "locked": { + "lastModified": 1654113405, + "narHash": "sha256-VpK+0QaWG2JRgB00lw77N9TjkE3ec0iMYIX1TzGpxa4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ac2287df5a2d6f0a44bbcbd11701dbbf6ec43675", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-22.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixos-2205": { + "locked": { + "lastModified": 1654005557, + "narHash": "sha256-J6elwUzPoco+r5qWPHhvS2EHVWomUtNcxzkfdAQOwEU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "08950a6e29cf7bddee466592eb790a417550f7f9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "locked": { + "lastModified": 1654123271, + "narHash": "sha256-xM85/VFYu8I8jZiZ7U0CmZO/98sHO7+f7PIMxQVZXCM=", + "owner": "nix-community", + "repo": "NUR", + "rev": "4c83235ccca7cfcf34fee9f49023f21c0e9db128", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "dan": "dan", + "home-manager-2205": "home-manager-2205", + "nixos-2205": "nixos-2205", + "nur": "nur", + "unstable": "unstable" + } + }, + "unstable": { + "locked": { + "lastModified": 1654007547, + "narHash": "sha256-G812EeXZeGeGjkAvbTleGwcKFCGxdLOQb9aViOWASPc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5643714dea562f0161529ab23058562afeff46d0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3483e27 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "dandellion's home-manager profiles"; + + inputs = { + home-manager-2205.url = "github:nix-community/home-manager/release-22.05"; + nixos-2205.url = "github:nixos/nixpkgs/nixos-22.05"; + home-manager-2205.inputs.nixpkgs.follows = "nixos-2205"; + + unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + + nur.url = "github:nix-community/NUR"; + nur.inputs.nixpkgs.follows = "unstable"; + + dan.url = "git+https://git.dodsorf.as/Dandellion/NUR"; + dan.inputs.nixpkgs.follows = "unstable"; + }; + + outputs = {home-manager-2205, unstable, nur, dan, ... }: + { + homeConfigurations.laptop = home-manager-2205.lib.homeManagerConfiguration { + configuration = import ./machines/laptop.nix; + system = "x86_64-linux"; + username = "daniel"; + homeDirectory = "/home/daniel"; + stateVersion = "22.05"; + extraSpecialArgs = { inherit nur unstable dan; }; + }; + }; +} diff --git a/machines/laptop.nix b/machines/laptop.nix index 10fc1ab..9d53671 100644 --- a/machines/laptop.nix +++ b/machines/laptop.nix @@ -1,5 +1,18 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, nur, unstable, dan, ... }: { + nixpkgs.overlays = [ + nur.overlay + (final: prev: { + unstable = import unstable { + inherit (prev) system; + config.allowUnfree = true; + }; + + dan = dan.packages.${prev.system}; + }) + ]; + nixpkgs.config.allowUnfreePredicate = (pkg: true); + imports = [ ../profiles ]; machine = {