From 6003461f0e3eca6b814d49ed290cee89ee69d4a3 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Wed, 26 Jan 2022 20:17:20 +0000 Subject: [PATCH] add examples --- examples/flake.lock | 58 ++++++++++++++++++++++++++++++++++++++++ examples/flake.nix | 24 +++++++++++++++++ flake.lock | 64 ++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 8 ++++-- 4 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 examples/flake.lock create mode 100644 examples/flake.nix diff --git a/examples/flake.lock b/examples/flake.lock new file mode 100644 index 0000000..b926986 --- /dev/null +++ b/examples/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "nixinate": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "narHash": "sha256-lk8eIWYxtHqDT4ZmSFuXMlG067RdPqLCQocnN+hNE7U=", + "path": "/etc/nixos/nixinate", + "type": "path" + }, + "original": { + "path": "/etc/nixos/nixinate", + "type": "path" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1640887906, + "narHash": "sha256-Eupk1UlNicCD2UNZuEKt6yhE6kFWAxXM/HyziOjG9CA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8a053bc2255659c5ca52706b9e12e76a8f50dbdd", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1641147223, + "narHash": "sha256-eJnmISYGR7LeqEev4bsI/qcU0SgeFKHs3jnL4vMGL+k=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "08370e1e271f6fe00d302bebbe510fe0e2c611ca", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixinate": "nixinate", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/examples/flake.nix b/examples/flake.nix new file mode 100644 index 0000000..538b69c --- /dev/null +++ b/examples/flake.nix @@ -0,0 +1,24 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; + nixinate.url = "path:///etc/nixos/nixinate"; + }; + + outputs = { self, nixpkgs, nixinate }: { + apps = nixinate.nixinate.x86_64-linux self; + nixosConfigurations = { + myMachine = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + { + _module.args.nixinate = { + host = "itchy.scratchy.com"; + sshUser = "matthew"; + }; + } + # ... other configuration ... + ]; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index 0f219fa..207452d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,34 @@ { "nodes": { + "examples": { + "inputs": { + "nixinate": "nixinate", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "narHash": "sha256-OsFQxO7h4YHrRQX8oHIjvgjTbeJx0oIP+pOIpfiwMiU=", + "path": "./examples", + "type": "path" + }, + "original": { + "path": "./examples", + "type": "path" + } + }, + "nixinate": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "narHash": "sha256-lk8eIWYxtHqDT4ZmSFuXMlG067RdPqLCQocnN+hNE7U=", + "path": "/etc/nixos/nixinate", + "type": "path" + }, + "original": { + "path": "/etc/nixos/nixinate", + "type": "path" + } + }, "nixpkgs": { "locked": { "lastModified": 1640887906, @@ -16,9 +45,42 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1641147223, + "narHash": "sha256-eJnmISYGR7LeqEev4bsI/qcU0SgeFKHs3jnL4vMGL+k=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "08370e1e271f6fe00d302bebbe510fe0e2c611ca", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1640887906, + "narHash": "sha256-Eupk1UlNicCD2UNZuEKt6yhE6kFWAxXM/HyziOjG9CA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8a053bc2255659c5ca52706b9e12e76a8f50dbdd", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "examples": "examples", + "nixpkgs": "nixpkgs_3" } } }, diff --git a/flake.nix b/flake.nix index 1d56423..73c2b97 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,10 @@ { description = "Nixinate your systems 🕶️"; - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; - outputs = { self, nixpkgs, ... }: + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11"; + examples.url = "path:./examples"; + }; + outputs = { self, nixpkgs, examples, ... }: let version = builtins.substring 0 8 self.lastModifiedDate; supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; @@ -43,5 +46,6 @@ }; }; nixinate = forAllSystems (system: nixpkgsFor.${system}.generateApps); + apps = nixinate.x86_64-linux examples; }; }