From a2f6f432313a580e0424a0a5a1b6305275a726ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 12 Aug 2023 07:36:17 +0100 Subject: [PATCH] add basic flakes action image --- .gitignore | 3 +++ README.md | 2 ++ flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c71f08 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +result +result/ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..7c31849 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +* `nix build '.#flakes-action' + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..960be77 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c42ee9c --- /dev/null +++ b/flake.nix @@ -0,0 +1,60 @@ +{ + description = "docker base images"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + pkgsStatic = pkgs.pkgsStatic; + lib = pkgs.lib; + + rustPlatform = pkgs.makeRustPlatform { + cargo = pkgs.cargo; + rustc = pkgs.rustc; + }; + + in { + packages = { + flakes-action = pkgs.dockerTools.buildImage { + name = "flakes-action"; + contents = with pkgs; [ + bash + coreutils + curl + gawk + git-lfs + gnused + nodejs + wget + sudo + nix + ]; + config = { + Env = [ + "LANG=en_GB.UTF-8" + ]; + }; + extraCommands = '' + ''; + + }; + + }; + + devShells = { + default = (pkgs.mkShell { + buildInputs = (with pkgs; [ + git-lfs + node + ]); + + }); + }; + }); +} +