From 8d21dd335e5259dadf832a5d1a7c72b9dd1f4400 Mon Sep 17 00:00:00 2001
From: notgne2
Date: Tue, 29 Sep 2020 15:10:06 -0700
Subject: Add license information, reformat Nix files, clean up
---
examples/system/README.md | 6 ++++++
examples/system/bare.nix | 4 ++++
examples/system/common.nix | 4 ++++
examples/system/configuration.nix | 6 +++++-
examples/system/flake.lock.license | 3 +++
examples/system/flake.nix | 17 +++++++++++------
examples/system/hello.nix | 9 ++++++---
examples/system/nix-pub.pem.license | 3 +++
examples/system/nix.key.license | 3 +++
9 files changed, 45 insertions(+), 10 deletions(-)
create mode 100644 examples/system/flake.lock.license
create mode 100644 examples/system/nix-pub.pem.license
create mode 100644 examples/system/nix.key.license
(limited to 'examples/system')
diff --git a/examples/system/README.md b/examples/system/README.md
index 1dea41f..daf649a 100644
--- a/examples/system/README.md
+++ b/examples/system/README.md
@@ -1,3 +1,9 @@
+
+
# Example nixos system deployment
This is an example of how to deploy a full nixos system with a separate user unit to a bare machine.
diff --git a/examples/system/bare.nix b/examples/system/bare.nix
index 282080f..46ba3b2 100644
--- a/examples/system/bare.nix
+++ b/examples/system/bare.nix
@@ -1,3 +1,7 @@
+# SPDX-FileCopyrightText: 2020 Serokell
+#
+# SPDX-License-Identifier: MPL-2.0
+
{
imports = [ ./common.nix ];
diff --git a/examples/system/common.nix b/examples/system/common.nix
index 7e7448e..83ea225 100644
--- a/examples/system/common.nix
+++ b/examples/system/common.nix
@@ -1,3 +1,7 @@
+# SPDX-FileCopyrightText: 2020 Serokell
+#
+# SPDX-License-Identifier: MPL-2.0
+
{
boot.loader.systemd-boot.enable = true;
diff --git a/examples/system/configuration.nix b/examples/system/configuration.nix
index b2b55cf..6d4234a 100644
--- a/examples/system/configuration.nix
+++ b/examples/system/configuration.nix
@@ -1,7 +1,11 @@
+# SPDX-FileCopyrightText: 2020 Serokell
+#
+# SPDX-License-Identifier: MPL-2.0
+
{
imports = [ ./common.nix ];
- networking.hostName = "example-nixos-syyyystem";
+ networking.hostName = "example-nixos-system";
users.users.hello = {
isNormalUser = true;
diff --git a/examples/system/flake.lock.license b/examples/system/flake.lock.license
new file mode 100644
index 0000000..9e9897d
--- /dev/null
+++ b/examples/system/flake.lock.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2020 Serokell
+
+SPDX-License-Identifier: MPL-2.0
\ No newline at end of file
diff --git a/examples/system/flake.nix b/examples/system/flake.nix
index 383960b..5179258 100644
--- a/examples/system/flake.nix
+++ b/examples/system/flake.nix
@@ -1,7 +1,10 @@
+# SPDX-FileCopyrightText: 2020 Serokell
+#
+# SPDX-License-Identifier: MPL-2.0
+
{
description = "Deploy a full system with hello service as a separate profile";
-
outputs = { self, nixpkgs }: {
nixosConfigurations.example-nixos-system = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
@@ -10,7 +13,8 @@
nixosConfigurations.bare = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
- modules = [ ./bare.nix "${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix" ];
+ modules =
+ [ ./bare.nix "${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix" ];
};
# This is the application we actually want to run
@@ -24,7 +28,8 @@
system = {
sshUser = "admin";
activate = "$PROFILE/bin/switch-to-configuration switch";
- path = self.nixosConfigurations.example-nixos-system.config.system.build.toplevel;
+ path =
+ self.nixosConfigurations.example-nixos-system.config.system.build.toplevel;
user = "root";
};
hello = {
@@ -38,9 +43,9 @@
checks = builtins.mapAttrs (_: pkgs: {
jsonschema = pkgs.runCommandNoCC "jsonschema-deploy-system" { }
- "${pkgs.python3.pkgs.jsonschema}/bin/jsonschema -i ${
- pkgs.writeText "deploy.json" (builtins.toJSON self.deploy)
- } ${../../interface/deploy.json} && touch $out";
+ "${pkgs.python3.pkgs.jsonschema}/bin/jsonschema -i ${
+ pkgs.writeText "deploy.json" (builtins.toJSON self.deploy)
+ } ${../../interface/deploy.json} && touch $out";
}) nixpkgs.legacyPackages;
};
}
diff --git a/examples/system/hello.nix b/examples/system/hello.nix
index 8c207f1..df57308 100644
--- a/examples/system/hello.nix
+++ b/examples/system/hello.nix
@@ -1,3 +1,7 @@
+# SPDX-FileCopyrightText: 2020 Serokell
+#
+# SPDX-License-Identifier: MPL-2.0
+
nixpkgs:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
@@ -14,11 +18,10 @@ let
text = mkService "hello" {
unitConfig.WantedBy = [ "multi-user.target" ];
path = [ pkgs.hello ];
- script = "hello -g lel; touch $HOME/oof";
+ script = "hello";
};
};
-in
-pkgs.writeShellScriptBin "activate" ''
+in pkgs.writeShellScriptBin "activate" ''
mkdir -p $HOME/.config/systemd/user
rm $HOME/.config/systemd/user/hello.service
ln -s ${service} $HOME/.config/systemd/user/hello.service
diff --git a/examples/system/nix-pub.pem.license b/examples/system/nix-pub.pem.license
new file mode 100644
index 0000000..9e9897d
--- /dev/null
+++ b/examples/system/nix-pub.pem.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2020 Serokell
+
+SPDX-License-Identifier: MPL-2.0
\ No newline at end of file
diff --git a/examples/system/nix.key.license b/examples/system/nix.key.license
new file mode 100644
index 0000000..9e9897d
--- /dev/null
+++ b/examples/system/nix.key.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2020 Serokell
+
+SPDX-License-Identifier: MPL-2.0
\ No newline at end of file
--
cgit v1.2.3