build: replace shell.nix with flake.nix for dev shell

This commit is contained in:
ezKEa 2024-07-17 07:14:55 -04:00
parent d83b74bb48
commit 14c71beb09
4 changed files with 80 additions and 40 deletions

2
.envrc
View file

@ -1 +1 @@
use nix
use flake

44
flake.lock Normal file
View file

@ -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
}

35
flake.nix Normal file
View file

@ -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
];
};
};
}

View file

@ -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
];
}