summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.envrc3
-rw-r--r--README.md8
-rw-r--r--com/simatime.nix50
-rw-r--r--com/simatime/dev.nix20
-rw-r--r--default.nix48
5 files changed, 56 insertions, 73 deletions
diff --git a/.envrc b/.envrc
index f0cdafa..f4c7001 100644
--- a/.envrc
+++ b/.envrc
@@ -1 +1,2 @@
-export GUILE_LOAD_PATH=.
+export GUILE_LOAD_PATH=$PWD
+export NIX_PATH=$PWD:$NIX_PATH
diff --git a/README.md b/README.md
index 378ea86..df6db66 100644
--- a/README.md
+++ b/README.md
@@ -15,11 +15,17 @@ well-defined. Likewise, the functionality and purpose of a particular namespace
should be small and well-defined. Following the unix principle of "do one thing
and do it well" is advised.
+# Development
+
To build code, do:
nix build -f default.nix <thing>
-Deploy:
+To get a repl:
+
+ nix run -f default.nix <thing>
+
+And to deploy:
nix copy --to ssh://root@simatime.com ./result
ssh root@simatime.com $(realpath ./result)/bin/switch-to-configuration switch
diff --git a/com/simatime.nix b/com/simatime.nix
deleted file mode 100644
index d67c756..0000000
--- a/com/simatime.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{ buildNixOS }:
-
-/*
-
-com.simatime - cloud infrastructure server.
-
-This serves the git repo, mailserver, znc bouncer, user sites, and so on.
-
-Currently also used as a catch-all production/staging server, until I get real
-stuff deployed.
-
-*/
-
-let
- nixos-mailserver = builtins.fetchTarball {
- url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.2.1/nixos-mailserver-v2.2.1.tar.gz";
- sha256 = "03d49v8qnid9g9rha0wg2z6vic06mhp0b049s3whccn1axvs2zzx";
- };
-in buildNixOS {
- system = "x86_64-linux";
- configuration = {
- imports = [
- ./simatime/hardware.nix
- ./simatime/networking.nix
- # common infra
- ./simatime/users.nix
- ./simatime/packages.nix
- # configured modules
- ./simatime/git.nix
- ./simatime/mail.nix
- ./simatime/web.nix
- ./simatime/znc.nix
- # third party
- nixos-mailserver
- ];
- nixpkgs.config.allowUnfree = true;
- programs.mosh = {
- enable = true;
- withUtempter = true;
- };
- services.openssh = {
- enable = true;
- passwordAuthentication = false;
- };
- security.sudo.wheelNeedsPassword = true;
- boot.cleanTmpDir = true;
- };
-} // {
- dev = import ./simatime/dev.nix { inherit buildNixOS; };
-}
diff --git a/com/simatime/dev.nix b/com/simatime/dev.nix
deleted file mode 100644
index b2ed3b0..0000000
--- a/com/simatime/dev.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ buildNixOS }:
-
-/*
-
-com.simatime.dev - main development/build server. Lives in ben's apartment in
-Mountain View.
-
-*/
-
-buildNixOS {
- system = "x86_64-linux";
- configuration = {
- imports = [
- ./users.nix
- ./packages.nix
- ./dev/hardware.nix
- ./dev/configuration.nix
- ];
- };
-}
diff --git a/default.nix b/default.nix
index aedf4a0..42b6c3a 100644
--- a/default.nix
+++ b/default.nix
@@ -9,8 +9,54 @@ let
vm = full.vm;
};
buildHaskellApp = import ./com/simatime/buildHaskellApp.nix nixpkgs;
+ nixos-mailserver = builtins.fetchTarball {
+ url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.2.1/nixos-mailserver-v2.2.1.tar.gz";
+ sha256 = "03d49v8qnid9g9rha0wg2z6vic06mhp0b049s3whccn1axvs2zzx";
+ };
in {
- com.simatime = import ./com/simatime.nix { inherit buildNixOS; };
+ com.simatime = buildNixOS {
+ system = "x86_64-linux";
+ configuration = {
+ imports = [
+ ./com/simatime/hardware.nix
+ ./com/simatime/networking.nix
+ # common infra
+ ./com/simatime/users.nix
+ ./com/simatime/packages.nix
+ # configured modules
+ ./com/simatime/git.nix
+ ./com/simatime/mail.nix
+ ./com/simatime/web.nix
+ ./com/simatime/znc.nix
+ # third party
+ nixos-mailserver
+ ];
+ # TODO(bsima): move more stuff here to a common module
+ nixpkgs.config.allowUnfree = true;
+ programs.mosh = {
+ enable = true;
+ withUtempter = true;
+ };
+ services.openssh = {
+ enable = true;
+ passwordAuthentication = false;
+ };
+ security.sudo.wheelNeedsPassword = true;
+ boot.cleanTmpDir = true;
+ };
+ } // {
+ dev = buildNixOS {
+ system = "x86_64-linux";
+ configuration = {
+ imports = [
+ ./com/simatime/users.nix
+ ./com/simatime/packages.nix
+ ./com/simatime/dev/hardware.nix
+ ./com/simatime/dev/configuration.nix
+ ];
+ };
+ };
+ };
com.influencedbybooks = buildNixOS {
system = "x86_64-linux";
configuration = {