From 4b73517739d1f055d166f69b1e43bad0f049d991 Mon Sep 17 00:00:00 2001 From: Isabel Date: Sun, 19 May 2024 17:51:50 +0100 Subject: [PATCH] refactor: nix flake (#180) --- flake.lock | 41 ++++------------------------------------- flake.nix | 29 +++++++++++++++-------------- shell.nix | 7 ++++--- 3 files changed, 23 insertions(+), 54 deletions(-) diff --git a/flake.lock b/flake.lock index b8877fc4..0c0646bf 100644 --- a/flake.lock +++ b/flake.lock @@ -1,58 +1,25 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1714495772, - "narHash": "sha256-BVkhvsIatul5lXMrnPvgKkpxL3zZGQlPbTgDlFJiYCo=", + "lastModified": 1715961556, + "narHash": "sha256-+NpbZRCRisUHKQJZF3CT+xn14ZZQO+KjxIIanH3Pvn4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c82cda9c0600a2785cda8e60962bcc9cc86862db", + "rev": "4a6b83b05df1a8bd7d99095ec4b4d271f2956b64", "type": "github" }, "original": { "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 525d40c7..1cfc9582 100644 --- a/flake.nix +++ b/flake.nix @@ -1,17 +1,18 @@ { - inputs = { - nixpkgs.url = "github:nixos/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - }; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - outputs = { self, nixpkgs, flake-utils, ... }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { inherit system; }; - in - { - devShells.default = import ./shell.nix { inherit pkgs; }; - } - ); + outputs = + { nixpkgs, ... }: + let + forAllSystems = + function: + nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed ( + system: function nixpkgs.legacyPackages.${system} + ); + in + { + devShells = forAllSystems (pkgs: { + default = pkgs.callPackage ./shell.nix { }; + }); + }; } - diff --git a/shell.nix b/shell.nix index 93ac74db..a5bc5667 100644 --- a/shell.nix +++ b/shell.nix @@ -1,10 +1,11 @@ -{ pkgs ? import { } }: - +{ + pkgs ? import { }, +}: pkgs.mkShell { name = "dev-shell"; buildInputs = with pkgs; [ python311 python311Packages.catppuccin + sassc ]; } -