From 14c71beb0965b44c8019afff7e46d2498fceaa53 Mon Sep 17 00:00:00 2001 From: ezKEa Date: Wed, 17 Jul 2024 07:14:55 -0400 Subject: [PATCH] build: replace shell.nix with flake.nix for dev shell --- .envrc | 2 +- flake.lock | 44 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 35 +++++++++++++++++++++++++++++++++++ shell.nix | 39 --------------------------------------- 4 files changed, 80 insertions(+), 40 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 shell.nix diff --git a/.envrc b/.envrc index 1d953f4..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use nix +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7ebb7d9 --- /dev/null +++ b/flake.lock @@ -0,0 +1,44 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1720954236, + "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1720957393, + "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1bcb04d --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs, nixpkgs-unstable }: let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + pkgs-unstable = nixpkgs-unstable.legacyPackages.x86_64-linux; + in { + devShells.x86_64-linux.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + pkgs-unstable.rustup + pkgs-unstable.rustfmt + pkgs-unstable.clippy + + gcc + cmake + pkg-config + + xdelta + libwebp + ]; + + buildInputs = with pkgs; [ + gtk4 + glib + gdk-pixbuf + gobject-introspection + + libadwaita + ]; + }; + }; +} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index bb939d1..0000000 --- a/shell.nix +++ /dev/null @@ -1,39 +0,0 @@ -let - nixpkgs = builtins.fetchGit { - name = "nixos-24.05"; - url = "https://github.com/nixos/nixpkgs"; - ref = "refs/heads/nixos-24.05"; - }; - - nixpkgs-unstable = builtins.fetchGit { - name = "nixos-unstable"; - url = "https://github.com/nixos/nixpkgs"; - ref = "refs/heads/nixos-unstable"; - }; - - pkgs = import nixpkgs {}; - pkgs-unstable = import nixpkgs-unstable {}; - -in pkgs.mkShell { - nativeBuildInputs = with pkgs; [ - pkgs-unstable.rustup - pkgs-unstable.rustfmt - pkgs-unstable.clippy - - gcc - cmake - pkg-config - - xdelta - libwebp - ]; - - buildInputs = with pkgs; [ - gtk4 - glib - gdk-pixbuf - gobject-introspection - - libadwaita - ]; -}