From c11ac8374832d5a01e0f8e8d25a723476944c9c2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Oct 2015 12:19:25 +0200 Subject: lass 2 desktop-base: add much --- lass/2configs/desktop-base.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lass') diff --git a/lass/2configs/desktop-base.nix b/lass/2configs/desktop-base.nix index ed84edef..4e693997 100644 --- a/lass/2configs/desktop-base.nix +++ b/lass/2configs/desktop-base.nix @@ -28,14 +28,14 @@ in { environment.systemPackages = with pkgs; [ powertop + sxiv + much #window manager stuff haskellPackages.xmobar haskellPackages.yeganesh dmenu2 xlibs.fontschumachermisc - - sxiv ]; fonts.fonts = [ -- cgit v1.2.3 From 7c8ea4a87b50c2ffe982a1ba0c70579bea7cb4dd Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Oct 2015 14:48:42 +0200 Subject: move realwallpaper to krebs 5 --- lass/5pkgs/default.nix | 1 - lass/5pkgs/realwallpaper.nix | 28 ---------------------------- 2 files changed, 29 deletions(-) delete mode 100644 lass/5pkgs/realwallpaper.nix (limited to 'lass') diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix index 6954c6a2..7427cb62 100644 --- a/lass/5pkgs/default.nix +++ b/lass/5pkgs/default.nix @@ -13,5 +13,4 @@ rec { ublock = callPackage ./firefoxPlugins/ublock.nix {}; vimperator = callPackage ./firefoxPlugins/vimperator.nix {}; }; - realwallpaper = callPackage ./realwallpaper.nix {}; } diff --git a/lass/5pkgs/realwallpaper.nix b/lass/5pkgs/realwallpaper.nix deleted file mode 100644 index 4fea977e..00000000 --- a/lass/5pkgs/realwallpaper.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ stdenv, fetchgit, xplanet, imagemagick, curl, file }: - -stdenv.mkDerivation { - name = "realwallpaper"; - - src = fetchgit { - url = https://github.com/Lassulus/realwallpaper; - rev = "c2778c3c235fc32edc8115d533a0d0853ab101c5"; - sha256 = "0yhbjz19zk8sj5dsvccm6skkqq2vardn1yi70qmd5li7qvp17mvs"; - }; - - phases = [ - "unpackPhase" - "installPhase" - ]; - - buildInputs = [ - xplanet - imagemagick - curl - file - ]; - - installPhase = '' - mkdir -p $out - cp realwallpaper.sh $out/realwallpaper.sh - ''; -} -- cgit v1.2.3 From cf28831057d95a73bbc2326f43b9d29a79fca12b Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Oct 2015 14:49:36 +0200 Subject: move realwallpaper to krebs 3 --- lass/3modules/default.nix | 1 - lass/3modules/realwallpaper.nix | 102 ---------------------------------------- 2 files changed, 103 deletions(-) delete mode 100644 lass/3modules/realwallpaper.nix (limited to 'lass') diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix index 9b621127..9de987bf 100644 --- a/lass/3modules/default.nix +++ b/lass/3modules/default.nix @@ -3,6 +3,5 @@ _: { imports = [ ./xresources.nix - ./realwallpaper.nix ]; } diff --git a/lass/3modules/realwallpaper.nix b/lass/3modules/realwallpaper.nix deleted file mode 100644 index 85dd3523..00000000 --- a/lass/3modules/realwallpaper.nix +++ /dev/null @@ -1,102 +0,0 @@ -arg@{ config, lib, pkgs, ... }: - -let - inherit (lib) - mkEnableOption - mkOption - types - mkIf - ; - - lpkgs = import ../5pkgs { inherit pkgs; }; - - cfg = config.lass.realwallpaper; - - out = { - options.lass.realwallpaper = api; - config = mkIf cfg.enable imp; - }; - - api = { - enable = mkEnableOption "realwallpaper"; - - workingDir = mkOption { - type = types.str; - default = "/var/realwallpaper/"; - }; - - nightmap = mkOption { - type = types.str; - default = "http://eoimages.gsfc.nasa.gov/images/imagerecords/55000/55167/earth_lights_lrg.jpg"; - }; - - daymap = mkOption { - type = types.str; - default = "http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png"; - }; - - cloudmap = mkOption { - type = types.str; - default = "http://xplanetclouds.com/free/local/clouds_2048.jpg"; - }; - - outFile = mkOption { - type = types.str; - default = "/tmp/wallpaper.png"; - }; - - timerConfig = mkOption { - type = types.unspecified; - default = { - OnCalendar = "*:0/15"; - }; - }; - - }; - - imp = { - systemd.timers.realwallpaper = { - description = "real wallpaper generator timer"; - - timerConfig = cfg.timerConfig; - }; - - systemd.services.realwallpaper = { - description = "real wallpaper generator"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - - path = with pkgs; [ - xplanet - imagemagick - curl - file - ]; - - environment = { - working_dir = cfg.workingDir; - nightmap_url = cfg.nightmap; - daymap_url = cfg.daymap; - cloudmap_url = cfg.cloudmap; - out_file = cfg.outFile; - }; - - restartIfChanged = true; - - serviceConfig = { - Type = "simple"; - ExecStart = "${lpkgs.realwallpaper}/realwallpaper.sh"; - User = "realwallpaper"; - }; - }; - - users.extraUsers.realwallpaper = { - uid = 2009435407; #genid realwallpaper - home = cfg.workingDir; - createHome = true; - }; - }; - -in -out - -- cgit v1.2.3 From 7820eae9b6f9a91927caf646074d5d2b79093489 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Oct 2015 14:50:07 +0200 Subject: lass 2 realwallpaper: update due to file move --- lass/2configs/realwallpaper.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lass') diff --git a/lass/2configs/realwallpaper.nix b/lass/2configs/realwallpaper.nix index f1c8861e..c69cb166 100644 --- a/lass/2configs/realwallpaper.nix +++ b/lass/2configs/realwallpaper.nix @@ -1,9 +1,5 @@ { config, ... }: { - imports = [ - ../3modules/realwallpaper.nix - ]; - - lass.realwallpaper.enable = true; + krebs.realwallpaper.enable = true; } -- cgit v1.2.3 From b4d2814e31b860199de1fd927c5f53609ef162c9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Oct 2015 14:51:37 +0200 Subject: lass 1 echelon: activate git --- lass/1systems/echelon.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass') diff --git a/lass/1systems/echelon.nix b/lass/1systems/echelon.nix index 45f7ebd7..b301b504 100644 --- a/lass/1systems/echelon.nix +++ b/lass/1systems/echelon.nix @@ -13,6 +13,7 @@ in { ../2configs/retiolum.nix ../2configs/realwallpaper-server.nix ../2configs/privoxy-retiolum.nix + ../2configs/git.nix { networking.interfaces.enp2s1.ip4 = [ { -- cgit v1.2.3 From f4f5633b0e0ec711202d2d56735b6b55c8c69138 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Oct 2015 14:52:24 +0200 Subject: lass 2 git: make echelon main git host --- lass/2configs/git.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass') diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index 78e6f0ba..595936da 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -51,7 +51,7 @@ let nick = config.krebs.build.host.name; channel = "#retiolum"; server = "cd.retiolum"; - verbose = config.krebs.build.host.name == "cloudkrebs"; + verbose = config.krebs.build.host.name == "echelon"; }; }; }; -- cgit v1.2.3 From 892c99706a1c997ae064e443c2162a5659b8a05e Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 8 Oct 2015 12:05:32 +0200 Subject: lass 2: add skype.nix --- lass/1systems/mors.nix | 1 + lass/2configs/skype.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 lass/2configs/skype.nix (limited to 'lass') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index 5cc03501..c0c33828 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -24,6 +24,7 @@ ../2configs/bitlbee.nix ../2configs/firefoxPatched.nix ../2configs/realwallpaper.nix + ../2configs/skype.nix ]; krebs.build = { diff --git a/lass/2configs/skype.nix b/lass/2configs/skype.nix new file mode 100644 index 00000000..7e4618a7 --- /dev/null +++ b/lass/2configs/skype.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +let + mainUser = config.users.extraUsers.mainUser; + +in { + imports = [ + ../3modules/per-user.nix + ]; + + users.extraUsers = { + skype = { + name = "skype"; + uid = 2259819492; #genid skype + description = "user for running skype"; + home = "/home/skype"; + useDefaultShell = true; + extraGroups = [ "audio" "video" ]; + createHome = true; + }; + }; + + lass.per-user.skype.packages = [ + pkgs.skype + ]; + + security.sudo.extraConfig = '' + ${mainUser.name} ALL=(skype) NOPASSWD: ALL + ''; +} -- cgit v1.2.3 From d2720415ac5404f3261a4dafbd97092c282dd169 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:06:22 +0200 Subject: lass 5: add go url shortener --- lass/5pkgs/default.nix | 1 + lass/5pkgs/go/default.nix | 61 ++++++++++++++++++++++++++++++++++++++++++++++ lass/5pkgs/go/packages.nix | 44 +++++++++++++++++++++++++++++++++ lass/5pkgs/go/result | 1 + 4 files changed, 107 insertions(+) create mode 100644 lass/5pkgs/go/default.nix create mode 100644 lass/5pkgs/go/packages.nix create mode 120000 lass/5pkgs/go/result (limited to 'lass') diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix index 7427cb62..e3e49e37 100644 --- a/lass/5pkgs/default.nix +++ b/lass/5pkgs/default.nix @@ -13,4 +13,5 @@ rec { ublock = callPackage ./firefoxPlugins/ublock.nix {}; vimperator = callPackage ./firefoxPlugins/vimperator.nix {}; }; + go = callPackage ./go/default.nix {}; } diff --git a/lass/5pkgs/go/default.nix b/lass/5pkgs/go/default.nix new file mode 100644 index 00000000..2ac809c3 --- /dev/null +++ b/lass/5pkgs/go/default.nix @@ -0,0 +1,61 @@ +{ stdenv, makeWrapper, lib, buildEnv, fetchgit, nodePackages, nodejs }: + +with lib; + +let + np = nodePackages.override { + generated = ./packages.nix; + self = np; + }; + + node_env = buildEnv { + name = "node_env"; + paths = [ + np.redis + np."formidable" + ]; + pathsToLink = [ "/lib" ]; + ignoreCollisions = true; + }; + +in nodePackages.buildNodePackage { + name = "go"; + + src = fetchgit { + url = "http://cgit.echelon/go/"; + rev = "05d02740e0adbb36cc461323647f0c1e7f493156"; + sha256 = "6015c9a93317375ae8099c7ab982df0aa93a59ec2b48972e253887bb6ca0004f"; + }; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + deps = (filter (v: nixType v == "derivation") (attrValues np)); + + buildInputs = [ + nodejs + nodePackages.redis + np.formidable + makeWrapper + ]; + + installPhase = '' + mkdir -p $out/bin + + find ${node_env} + + cp index.js $out/ + cat > $out/go << EOF + ${nodejs}/bin/node $out/index.js + EOF + chmod +x $out/go + + wrapProgram $out/go \ + --prefix NODE_PATH : ${node_env}/lib/node_modules + + ln -s $out/go /$out/bin/go + ''; + +} diff --git a/lass/5pkgs/go/packages.nix b/lass/5pkgs/go/packages.nix new file mode 100644 index 00000000..9acfd765 --- /dev/null +++ b/lass/5pkgs/go/packages.nix @@ -0,0 +1,44 @@ +{ self, fetchurl, fetchgit ? null, lib }: + +{ + by-spec."formidable"."*" = + self.by-version."formidable"."1.0.17"; + by-version."formidable"."1.0.17" = self.buildNodePackage { + name = "formidable-1.0.17"; + version = "1.0.17"; + bin = false; + src = fetchurl { + url = "http://registry.npmjs.org/formidable/-/formidable-1.0.17.tgz"; + name = "formidable-1.0.17.tgz"; + sha1 = "ef5491490f9433b705faa77249c99029ae348559"; + }; + deps = { + }; + optionalDependencies = { + }; + peerDependencies = []; + os = [ ]; + cpu = [ ]; + }; + "formidable" = self.by-version."formidable"."1.0.17"; + by-spec."redis"."*" = + self.by-version."redis"."2.1.0"; + by-version."redis"."2.1.0" = self.buildNodePackage { + name = "redis-2.1.0"; + version = "2.1.0"; + bin = false; + src = fetchurl { + url = "http://registry.npmjs.org/redis/-/redis-2.1.0.tgz"; + name = "redis-2.1.0.tgz"; + sha1 = "38acb208f90750250f9451219b73ff08ae907f94"; + }; + deps = { + }; + optionalDependencies = { + }; + peerDependencies = []; + os = [ ]; + cpu = [ ]; + }; + "redis" = self.by-version."redis"."2.1.0"; +} diff --git a/lass/5pkgs/go/result b/lass/5pkgs/go/result new file mode 120000 index 00000000..14893ca3 --- /dev/null +++ b/lass/5pkgs/go/result @@ -0,0 +1 @@ +/nix/store/nizallgwxcx4fz9awyfp9i17avfymlvx-nodejs-go \ No newline at end of file -- cgit v1.2.3 From 45acff36265352e168928399957241abf4eb0dc1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:07:44 +0200 Subject: lass 2 git: add go repo --- lass/2configs/git.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass') diff --git a/lass/2configs/git.nix b/lass/2configs/git.nix index 595936da..d63705ab 100644 --- a/lass/2configs/git.nix +++ b/lass/2configs/git.nix @@ -31,6 +31,7 @@ let }; wai-middleware-time = {}; web-routes-wai-custom = {}; + go = {}; }; restricted-repos = mapAttrs make-restricted-repo ( -- cgit v1.2.3 From e4b27b52864cd40367b28c9967f1e375988a5445 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:08:27 +0200 Subject: lass 1 echelon: get hostName from build.host.name --- lass/1systems/echelon.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass') diff --git a/lass/1systems/echelon.nix b/lass/1systems/echelon.nix index b301b504..bf3ca872 100644 --- a/lass/1systems/echelon.nix +++ b/lass/1systems/echelon.nix @@ -44,6 +44,6 @@ in { }; }; - networking.hostName = "echelon"; + networking.hostName = config.krebs.build.host.name; } -- cgit v1.2.3 From d478ed4e06dbf84688bb99aa00b95e1d8b09f3b1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:09:13 +0200 Subject: lass 2 ircd: change sid and hostname --- lass/2configs/ircd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lass') diff --git a/lass/2configs/ircd.nix b/lass/2configs/ircd.nix index f71b769f..fc0aeb84 100644 --- a/lass/2configs/ircd.nix +++ b/lass/2configs/ircd.nix @@ -5,8 +5,8 @@ enable = true; config = '' serverinfo { - name = "ire.irc.retiolum"; - sid = "4z3"; + name = "${config.krebs.build.host.name}.irc.retiolum"; + sid = "1as"; description = "miep!"; network_name = "irc.retiolum"; network_desc = "Retiolum IRC Network"; -- cgit v1.2.3 From 20724bfcf7cb10a6e8ebf153e46ffac3d9ebbf67 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:10:15 +0200 Subject: lass 2: add redix.nix --- lass/2configs/redis.nix | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lass/2configs/redis.nix (limited to 'lass') diff --git a/lass/2configs/redis.nix b/lass/2configs/redis.nix new file mode 100644 index 00000000..8dd8df5c --- /dev/null +++ b/lass/2configs/redis.nix @@ -0,0 +1,8 @@ +{ config, ... }: + +{ + config.services.redis = { + enable = true; + bind = "127.0.0.1"; + }; +} -- cgit v1.2.3 From 4752e4a75765faeea6a2d8aa26c78c106d266a1c Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:11:29 +0200 Subject: lass 3: add go.nix --- lass/3modules/go.nix | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lass/3modules/go.nix (limited to 'lass') diff --git a/lass/3modules/go.nix b/lass/3modules/go.nix new file mode 100644 index 00000000..aa900f11 --- /dev/null +++ b/lass/3modules/go.nix @@ -0,0 +1,61 @@ +{ config, lib, pkgs, ... }: + +with builtins; +with lib; + +let + cfg = config.lass.go; + + out = { + options.lass.go = api; + config = mkIf cfg.enable imp; + }; + + api = { + enable = mkEnableOption "Enable go url shortener"; + port = mkOption { + type = types.str; + default = "1337"; + description = "on which port go should run on"; + }; + redisKeyPrefix = mkOption { + type = types.str; + default = "go:"; + description = "change the Redis key prefix which defaults to `go:`"; + }; + }; + + imp = { + users.extraUsers.go = { + name = "go"; + uid = 42774411; #genid go + description = "go url shortener user"; + home = "/var/lib/go"; + createHome = true; + }; + + systemd.services.go = { + description = "go url shortener"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + path = with pkgs; [ + go + ]; + + environment = { + PORT = cfg.port; + REDIS_KEY_PREFIX = cfg.redisKeyPrefix; + }; + + restartIfChanged = true; + + serviceConfig = { + User = "go"; + Restart = "always"; + ExecStart = "${pkgs.go}/bin/go"; + }; + }; + }; + +in out -- cgit v1.2.3 From 8b42c0631e86da5e05a4659887d9c7958bf27636 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:23:45 +0200 Subject: lass 2 ircd: open port 6667 to retiolum --- lass/2configs/ircd.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lass') diff --git a/lass/2configs/ircd.nix b/lass/2configs/ircd.nix index fc0aeb84..de96ad9d 100644 --- a/lass/2configs/ircd.nix +++ b/lass/2configs/ircd.nix @@ -1,6 +1,9 @@ { config, pkgs, ... }: { + krebs.iptables.tables.filter.INPUT.rules = [ + { predicate = "-i retiolum -p tcp --dport 6667"; target = "ACCEPT"; } + ]; config.services.charybdis = { enable = true; config = '' -- cgit v1.2.3 From c8c2b254e5f633618b43be6b348c747e903f7577 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:24:13 +0200 Subject: lass 2: add go.nix --- lass/2configs/go.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lass/2configs/go.nix (limited to 'lass') diff --git a/lass/2configs/go.nix b/lass/2configs/go.nix new file mode 100644 index 00000000..30d3e6ae --- /dev/null +++ b/lass/2configs/go.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ../3modules/go.nix + ]; + environment.systemPackages = [ + pkgs.go + ]; + lass.go = { + enable = true; + }; + krebs.iptables.tables.filter.INPUT.rules = [ + { predicate = "-i retiolum -p tcp --dport 1337"; target = "ACCEPT"; } + ]; +} -- cgit v1.2.3 From e21fdefcf1cec589db1aec4226bc52a65991b218 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:24:50 +0200 Subject: lass 1 echelon: import new stuff --- lass/1systems/echelon.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lass') diff --git a/lass/1systems/echelon.nix b/lass/1systems/echelon.nix index bf3ca872..1320e078 100644 --- a/lass/1systems/echelon.nix +++ b/lass/1systems/echelon.nix @@ -14,6 +14,9 @@ in { ../2configs/realwallpaper-server.nix ../2configs/privoxy-retiolum.nix ../2configs/git.nix + ../2configs/redis.nix + ../2configs/go.nix + ../2configs/ircd.nix { networking.interfaces.enp2s1.ip4 = [ { -- cgit v1.2.3 From 4072a32f89b9cc1c1e7c3583ac5b9ce5dcb004af Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 9 Oct 2015 01:31:42 +0200 Subject: lass 5 go: remove debug stuff --- lass/5pkgs/go/default.nix | 2 -- lass/5pkgs/go/result | 1 - 2 files changed, 3 deletions(-) delete mode 120000 lass/5pkgs/go/result (limited to 'lass') diff --git a/lass/5pkgs/go/default.nix b/lass/5pkgs/go/default.nix index 2ac809c3..3b4468d1 100644 --- a/lass/5pkgs/go/default.nix +++ b/lass/5pkgs/go/default.nix @@ -44,8 +44,6 @@ in nodePackages.buildNodePackage { installPhase = '' mkdir -p $out/bin - find ${node_env} - cp index.js $out/ cat > $out/go << EOF ${nodejs}/bin/node $out/index.js diff --git a/lass/5pkgs/go/result b/lass/5pkgs/go/result deleted file mode 120000 index 14893ca3..00000000 --- a/lass/5pkgs/go/result +++ /dev/null @@ -1 +0,0 @@ -/nix/store/nizallgwxcx4fz9awyfp9i17avfymlvx-nodejs-go \ No newline at end of file -- cgit v1.2.3