feat: add flake.nix to assist local development

This commit is contained in:
Martin Wimpress 2024-04-16 16:56:06 +01:00 committed by Martin Wimpress
parent 9b5593749b
commit 4281e0daf3
4 changed files with 97 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

2
.gitignore vendored
View File

@ -6,6 +6,7 @@
*.img
*.iso
*.lock
!flake.lock
*.log
*.markdownlint.jsonc
*.markdownlint.yaml
@ -19,3 +20,4 @@
*.sock
*.xml
*.zs-old
.direnv/

40
flake.lock Normal file
View File

@ -0,0 +1,40 @@
{
"nodes": {
"flake-schemas": {
"locked": {
"lastModified": 1697467827,
"narHash": "sha256-j8SR19V1SRysyJwpOBF4TLuAvAjF5t+gMiboN4gYQDU=",
"rev": "764932025c817d4e500a8d2a4d8c565563923d29",
"revCount": 29,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.2/018b3da8-4cc3-7fbb-8ff7-1588413c53e2/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%2A.tar.gz"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1712963716,
"narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=",
"rev": "cfd6b5fc90b15709b780a5a1619695a88505a176",
"revCount": 611350,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.611350%2Brev-cfd6b5fc90b15709b780a5a1619695a88505a176/018eddfc-e6d9-74bb-a823-20f2ae60079b/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
}
},
"root": {
"inputs": {
"flake-schemas": "flake-schemas",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

54
flake.nix Normal file
View File

@ -0,0 +1,54 @@
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.10)
{
# A helpful description of your flake
description = "Quickemu";
# Flake inputs
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
};
# Flake outputs that other flakes can use
outputs = { self, flake-schemas, nixpkgs }:
let
# Helpers for producing system-specific outputs
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in {
# Schemas tell Nix about the structure of your flake's outputs
schemas = flake-schemas.schemas;
# Development environments
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
# Pinned packages available in the environment
packages = with pkgs; [
cdrtools
curl
lsb-release
git
gnugrep
gnused
jq
nixpkgs-fmt
procps
python3
qemu
socat
swtpm
unzip
usbutils
util-linux
wget
xdg-user-dirs
xorg.xrandr
zsync
];
};
});
};
}