Clean up and update flake

pull/6/head
Tristan Daniël Maat 2022-07-30 17:42:07 +01:00
parent 99524e6a82
commit ca369cd30e
Signed by: tlater
GPG Key ID: 49670FD774E43268
2 changed files with 32 additions and 18 deletions

View File

@ -1,26 +1,27 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "nix-filter": {
"locked": { "locked": {
"lastModified": 1653893745, "lastModified": 1653590866,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "narHash": "sha256-E4yKIrt/S//WfW5D9IhQ1dVuaAy8RE7EiCMfnbrOC78=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "nix-filter",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", "rev": "3e81a637cdf9f6e9b39aeb4d6e6394d1ad158e16",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "flake-utils", "owner": "numtide",
"type": "indirect" "repo": "nix-filter",
"type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1655200170, "lastModified": 1659052185,
"narHash": "sha256-/yzkX+10sJhYNIcTtZ5ObS+nh/HrJp01XLaubzbRDcU=", "narHash": "sha256-TUbwbzCbprtWB9EtXPM52cWuKETuCV3H+cMXjLRbwTw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9ff91ce2e4c5d70551d4c8fd8830931c6c6b26b8", "rev": "9370544d849be8a07193e7611d02e6f6f1b10768",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -48,7 +49,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "nix-filter": "nix-filter",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"npmlock2nix": "npmlock2nix" "npmlock2nix": "npmlock2nix"
} }

View File

@ -3,6 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
nix-filter.url = "github:numtide/nix-filter";
npmlock2nix = { npmlock2nix = {
url = "github:nix-community/npmlock2nix"; url = "github:nix-community/npmlock2nix";
flake = false; flake = false;
@ -12,7 +13,7 @@
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
flake-utils, nix-filter,
npmlock2nix, npmlock2nix,
}: let }: let
# At the moment, we only deploy to x86_64-linux. Update when we # At the moment, we only deploy to x86_64-linux. Update when we
@ -27,7 +28,11 @@
in { in {
packages.${system} = rec { packages.${system} = rec {
tlaternet-templates = pkgs.npmlock2nix.build { tlaternet-templates = pkgs.npmlock2nix.build {
src = self; src = pkgs.lib.cleanSource self;
buildInputs = with pkgs; [
util-linux
];
installPhase = '' installPhase = ''
cp -r dist $out/ cp -r dist $out/
@ -35,8 +40,6 @@
node_modules_attrs = { node_modules_attrs = {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
elmPackages.elm
pkg-config pkg-config
python3 python3
vips vips
@ -50,11 +53,21 @@
devShells.${system} = { devShells.${system} = {
default = pkgs.npmlock2nix.shell { default = pkgs.npmlock2nix.shell {
src = self; src = nix-filter.lib {
root = self;
include = [
"package.json"
"package-lock.json"
];
};
buildInputs = with pkgs.nodePackages; [
npm-check-updates
prettier
];
node_modules_attrs = { node_modules_attrs = {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
elmPackages.elm
pkg-config pkg-config
python3 python3
vips vips