flake: add overlay and package

This commit is contained in:
b12f 2024-09-12 19:37:37 +02:00
parent 9ac91e7643
commit 63800cc25f
Signed by: b12f
GPG key ID: 729956E1124F8F26
3 changed files with 100 additions and 50 deletions

43
.editorconfig Normal file
View file

@ -0,0 +1,43 @@
# Editor configuration, see http://editorconfig.org
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2
# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = unset
charset = unset
indent_style = unset
indent_size = unset
[{.*,secrets}/**]
end_of_line = false
insert_final_newline = false
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.rom]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.py]
indent_size = 4
[*.md]
max_line_length = off
trim_trailing_whitespace = false

View file

@ -1,40 +1,20 @@
{ {
"nodes": { "nodes": {
"devshell": { "flake-parts": {
"inputs": { "inputs": {
"flake-utils": [ "nixpkgs-lib": "nixpkgs-lib"
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1678957337, "lastModified": 1726153070,
"narHash": "sha256-Gw4nVbuKRdTwPngeOZQOzH/IFowmz4LryMPDiJN/ah4=", "narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
"owner": "numtide", "owner": "hercules-ci",
"repo": "devshell", "repo": "flake-parts",
"rev": "3e0e60ab37cd0bf7ab59888f5c32499d851edb47", "rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "hercules-ci",
"repo": "devshell", "repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github" "type": "github"
} }
}, },
@ -54,10 +34,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1725233747,
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
}
},
"root": { "root": {
"inputs": { "inputs": {
"devshell": "devshell", "flake-parts": "flake-parts",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -4,27 +4,43 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-parts.url = "github:hercules-ci/flake-parts";
devshell.url = "github:numtide/devshell";
devshell.inputs.flake-utils.follows = "flake-utils";
devshell.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, flake-utils, devshell, nixpkgs }: outputs = inputs@{ self, ... }:
flake-utils.lib.simpleFlake { inputs.flake-parts.lib.mkFlake { inherit inputs; } {
inherit self nixpkgs; systems = [
name = "infra-project"; "x86_64-linux"
overlay = devshell.overlays.default; "aarch64-linux"
shell = { pkgs }:
pkgs.devshell.mkShell {
# Add additional packages you'd like to be available in your devshell
# PATH here
devshell.packages = with pkgs; [
minio-client
]; ];
bash.extra = '' imports = [
inputs.flake-parts.flakeModules.easyOverlay
];
perSystem =
args@{
system,
pkgs,
config,
lib,
...
}:
{
packages = {
momo-koeln = pkgs.stdenv.mkDerivation {
name = "momo.koeln";
version = "1.0.0";
src = ./.;
installPhase = ''
mkdir -p $out
cp -r index.html $out/
''; '';
}; };
}; };
overlayAttrs = config.packages;
devShells.default = pkgs.mkShell {
buildInputs = [ ];
};
};
};
} }