diff --git a/.gitignore b/.gitignore index 89b3a77..ed715a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -secrets.nix +/secrets.nix +/result diff --git a/config.nix b/configs/base/default.nix similarity index 58% rename from config.nix rename to configs/base/default.nix index d315ecf..956e685 100644 --- a/config.nix +++ b/configs/base/default.nix @@ -1,17 +1,12 @@ -{ config, lib, pkgs, ... }: -let - helpers = import ./helpers.nix; -in { +{ config, pkgs, ... }: +{ imports = [ "${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos" - ./options.nix - configs/hu-berlin.nix - configs/shells.nix - configs/editors.nix - configs/graphics.nix - configs/packages.nix - configs/networks.nix - configs/retiolum.nix + ./editors.nix + ./networks.nix + ./scripts.nix + ./shells.nix + ../../options.nix ]; time.timeZone = "Europe/Berlin"; @@ -31,6 +26,12 @@ in { ''; }; + i18n = { + defaultLocale = "en_GB.UTF-8"; + consoleKeyMap = "de"; + # consoleColors = with import ../theme.nix; map (c: lib.strings.removePrefix "#" c) colorPalette; + }; + services.printing = { enable = true; drivers = [ pkgs.hplipWithPlugin ]; @@ -51,31 +52,11 @@ in { home = "/home/kfm"; createHome = true; group = "users"; - extraGroups = [ "wheel" "audio" "docker" ]; + extraGroups = [ "wheel" "audio" ]; hashedPassword = "$6$w9hXyGFl/.IZBXk$5OiWzS1G.5hImhh1YQmZiCXYNAJhi3X6Y3uSLupJNYYXPLMsQpx2fwF4Xr2uYzGMV8Foqh8TgUavx1APD9rcb/"; shell = pkgs.zsh; }; - systemd.services.google-drive = { - description = "Google Drive synchronisation service"; - wants = [ "network-online.target" ]; - script = '' - ${pkgs.grive2}/bin/grive -p ${config.users.users.kfm.home}/cloud/gdrive - ''; - startAt = "*:0/5"; - serviceConfig = { - Restart = "on-failure"; - User = "kfm"; - }; - }; - - programs.tmux = { - enable = true; - extraTmuxConf = import dot/tmux.nix; - keyMode = "vi"; - terminal = "screen-256color"; - }; - home-manager.users.kfm = { programs.git = { enable = true; @@ -96,12 +77,63 @@ in { }; home.file = { - ".config/mpv/input.conf".text = import dot/mpv.nix; - ".config/Typora/themes/base.user.css".text = import dot/typora.nix; - ".ghc/ghci.conf".text = import dot/ghci.nix { inherit pkgs; }; - ".config/htop/htoprc".text = import dot/htop.nix; - ".stack/config.yaml".text = import dot/stack.nix { user = config.constants.user; }; + ".config/htop/htoprc".text = import ../../dot/htop.nix; ".zshrc".text = "# nothing to see here"; }; }; + + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + ] ++ [ # internet + aria2 + w3m + wget + curl + httpie + whois + ] ++ [ # media + imagemagick + ] ++ [ # archive + unzip + unrar + p7zip + zip + ] ++ [ # monitor + htop + iotop + iftop + lsof + psmisc + ] ++ [ # shell + bat + dos2unix + fd + file + git + gitAndTools.hub + gitstats + jo + jq + manpages + patch + patchutils + posix_man_pages + most + ranger + ripgrep + rlwrap + tree + ] ++ [ # hardware + pmount + usbutils + pciutils + ]; + + programs.command-not-found.enable = true; + programs.java = { + enable = true; + package = pkgs.openjdk; + }; + } diff --git a/configs/editors.nix b/configs/base/editors.nix similarity index 98% rename from configs/editors.nix rename to configs/base/editors.nix index 5c993ee..6522d70 100644 --- a/configs/editors.nix +++ b/configs/base/editors.nix @@ -1,5 +1,4 @@ { pkgs, config, ... }: -with import ../helpers.nix; let vim_conf = '' " if tabular vmap a= :Tabularize /= @@ -16,7 +15,7 @@ let vim_conf = '' set number set path=$PWD/** set completeopt=menu,longest - set wildmode=list:full wildignore+=${commaSep config.constants.ignore} + set wildmode=list:full wildignore+=${builtins.concatStringsSep "," config.constants.ignore} set shortmess+=aI set nowritebackup noswapfile set mouse=a diff --git a/configs/base/networks.nix b/configs/base/networks.nix new file mode 100644 index 0000000..666adfd --- /dev/null +++ b/configs/base/networks.nix @@ -0,0 +1,57 @@ +{ pkgs, config, lib, ... }: +let + sshPort = 22022; + sshKey = { + homeros = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDn13Y6CznabMvKJPIrr/dj1TX4boe8F98yc3FDElJeprQo2RXlDzjg/po9/lHTHaoC5yQUjlRg/AnI4vizYkn2sqJebAeSPahmpS+l0eFnjZgsqds2cCFqSPB6Qc5YEkGRhN4aq/ABz0jdFJLBYOYGxuuXowYxyNrqrItxDR7tF7upG+kVjYiDoP/qFm8C7zv6Zy8aoehNbzf8HlIJd0ITbMr/vUftNsQ8C84QmbZljReHmchPgE8GUfVLTlCORkhndbvNX3jXo+75y7JOIZZ6193FZHM4seg/VSDWYLJtpnhttD1w6qmiLrlimqbJB9ihoXq2eDmQ+4zo6hxQ6pFH6P0xQClJ0hxVWn6hEM3rkMwoMfbq4v54gKJsYxcGdnwjAX6d9DQv/QVjmVZffKWsGGoC7uz7bdmc0akVKi+GLSPOx8sJwXqvyvFStfqLaweVcuikUqQ72JLK7pZyliA7na6KuQ1PE3LTpfSr0lbBJ73xtS2rU1nF/Oe5zwA4LX5s/QeDVmS86D8acUrSCO62pBB3Yv8go0KR4mEvfxLiUWV6gR2uTeIPXvo4ouYFZqyABAGybjUATlGCXJaeHd/y/VWkpIB8ocqNESlRMCEe4TrYjw91AEmYBL6kWIeop3dyhovm3dTB3fQvC97kbL16wuXBrOcN4lEc+56ShhmvdQ== kieran.meinhardt@gmail.com"; + scardanelli = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC19H0FhSNWcfBRPKzbTVSMJikIWZl0CoM8zCm+/3fdMgoaLRpeZWe/AfDK6b4qOjk/sez/J0JUFCGr+JbMwjsduoazsuQowu9L9DLP9Q5UkJje4BD7MHznaeu9/XfVng/MvyaEWArA/VUJeKQesHe76tR511/+n3+bdzlIh8Zw/3wfFxmg1OTNA99/vLkXrQzHDTuV/yj1pxykL4xFtN0OIssW1IKncJeKtkO/OHGT55ypz52Daj6bNKqvxiTuzeEhv5M+5ppyIPcRf1uj/7IaPKttCgZAntEqBTIR9MbyXFeAZVayzaFnLl2okeam5XreeZbj+Y1h2ZjxiIuWoab3MLndSekVfLtfa63gtcWIf8CIvZO2wJoH8v73y0U78JsfWVaTM09ZCfFlHHA/bWqZ6laAjW+mWLO/c77DcYkB3IBzaMVNfc6mfTcGFIC+biWeYpKgA0zC6rByUPbmbIoMueP9zqJwqUaM90Nwd6559inBB107/BK3Ktb3b+37mMCstetIPB9e4EFpGMjhmnL/G81jS53ACWLXJYzt7mKU/fEsiW93MtaB+Le46OEC18y/4G8F7p/nnH7i0kO74ukxbnc4PlpiM7iWT6ra2Cyy+nzEgdXCNXywIxr05TbCQDwX6/NY8k7Hokgdfyz+1Pq3sX0yCcWRPaoB26YF12KYFQ== kieran.meinhardt@gmail.com"; + }; +in { + networking.hosts = lib.mapAttrs (_: value: [ (value + ".local") ]) { + "192.168.178.1" = "router"; + "192.168.178.21" = "scardanelli"; + "192.168.178.22" = "homeros"; + "192.168.178.24" = "catullus"; + "192.168.178.27" = "printer"; + }; + + home-manager.users.kfm = { + programs.ssh = { + enable = true; + matchBlocks = { + catullus = { + hostname = "catullus.local"; + user = "kfm"; + port = sshPort; + }; + scardanelli = { + hostname = "scardanelli.local"; + user = "kfm"; + port = sshPort; + }; + homeros = { + hostname = "homeros.local"; + user = "kfm"; + port = sshPort; + }; + }; + }; + }; + + programs.ssh = { + startAgent = true; + forwardX11 = true; + }; + + services.openssh = { + ports = [ sshPort ]; + enable = true; + forwardX11 = true; + passwordAuthentication = false; + }; + + users.users.kfm.openssh.authorizedKeys.keys = [ + sshKey.homeros + sshKey.scardanelli + ]; + +} diff --git a/dot/scripts.nix b/configs/base/scripts.nix similarity index 99% rename from dot/scripts.nix rename to configs/base/scripts.nix index a48967a..f2c20d5 100644 --- a/dot/scripts.nix +++ b/configs/base/scripts.nix @@ -1,6 +1,6 @@ -{ pkgs, lib }: +{ pkgs, lib, ... }: let - theme = import ../theme.nix; + theme = import ../../theme.nix; unstable = import {}; bingWallpaper = unstable.writers.writeBash "bing-wallpaper.sh" '' PICTURE_DIR="$HOME/pictures/external/bing/" @@ -496,4 +496,6 @@ let wait ${q-todo} ''; -in lib.attrsets.attrValues scripts +in { + users.users.kfm.packages = lib.attrsets.attrValues scripts; +} diff --git a/configs/shells.nix b/configs/base/shells.nix similarity index 92% rename from configs/shells.nix rename to configs/base/shells.nix index a3d01d4..24017c3 100644 --- a/configs/shells.nix +++ b/configs/base/shells.nix @@ -52,4 +52,10 @@ enableCompletion = true; }; + programs.tmux = { + enable = true; + extraTmuxConf = import ../../dot/tmux.nix; + keyMode = "vi"; + terminal = "screen-256color"; + }; } diff --git a/configs/docker.nix b/configs/docker.nix new file mode 100644 index 0000000..62d50be --- /dev/null +++ b/configs/docker.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: +{ + virtualisation.docker.enable = true; + users.users.kfm.extraGroups = [ "docker" ]; +} diff --git a/configs/google-drive.nix b/configs/google-drive.nix new file mode 100644 index 0000000..a75c2c3 --- /dev/null +++ b/configs/google-drive.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: +{ + systemd.services.google-drive = { + description = "Google Drive synchronisation service"; + wants = [ "network-online.target" ]; + script = '' + ${pkgs.grive2}/bin/grive -p ${config.users.users.kfm.home}/cloud/gdrive + ''; + startAt = "*:0/5"; + serviceConfig = { + Restart = "on-failure"; + User = "kfm"; + }; + }; +} diff --git a/configs/graphics.nix b/configs/graphical.nix similarity index 70% rename from configs/graphics.nix rename to configs/graphical.nix index 7724326..8a0c289 100644 --- a/configs/graphics.nix +++ b/configs/graphical.nix @@ -1,6 +1,6 @@ { pkgs, lib, config, ... }: { - services.xserver = with import ../helpers.nix; with import ../theme.nix; { + services.xserver = let commaSep = builtins.concatStringsSep ","; in with import ../theme.nix; { enable = true; layout = commaSep [ "de" "gr" "ru" ]; xkbVariant = commaSep [ "T3" "polytonic" "phonetic_winkeys" ]; @@ -37,12 +37,6 @@ }.${config.networking.hostName}; }; - i18n = { - defaultLocale = "en_GB.UTF-8"; - consoleKeyMap = "de"; - consoleColors = with import ../theme.nix; map (c: lib.strings.removePrefix "#" c) colorPalette; - }; - services.compton = { enable = true; shadow = true; @@ -63,30 +57,78 @@ timeout = 10; }; + fonts.enableDefaultFonts = true; + fonts.fonts = with pkgs; [ + cantarell-fonts + corefonts + eb-garamond + fira + libertine + lmodern + noto-fonts + powerline-fonts + roboto + xlibs.fontschumachermisc + ubuntu_font_family + ]; + + # packages for X + environment.systemPackages = with pkgs; [ + config.constants.theme.gtk.package + config.constants.theme.icon.package + config.constants.theme.cursor.package + arandr + libnotify + xclip + xorg.xkill + wpa_supplicant_gui + ] ++ [ # office + abiword + gnumeric + # typora + ] ++ [ # internet + chromium + firefox + tor-browser-bundle-bin + thunderbird + ] ++ [ # media + ffmpeg + mpv + pamixer + pavucontrol + gthumb + sxiv + blueman + zathura + ]; + + services.urxvtd.enable = true; + services.dbus.packages = [ pkgs.gnome3.dconf ]; + home-manager.users.kfm = { gtk = { enable = true; - # font = with import ../theme.nix; { package = pkgs.noto-fonts; name = uiFont.name; }; iconTheme = config.constants.theme.icon; theme = config.constants.theme.gtk; }; - qt = { enable = true; useGtkTheme = true; }; - xsession.pointerCursor = config.constants.theme.cursor // { size = 16; }; - xsession.windowManager.i3 = { enable = true; config = import ../dot/i3.nix { inherit lib pkgs config; }; }; - xresources.properties = import ../dot/xresources.nix { inherit lib; }; programs.rofi = import ../dot/rofi.nix { inherit config; }; services.dunst = import ../dot/dunst.nix { inherit pkgs config; }; programs.urxvt = import ../dot/urxvt.nix { inherit pkgs; }; programs.zathura = import ../dot/zathura.nix; + + home.file = { + ".config/mpv/input.conf".text = import ../dot/mpv.nix; + # ".config/Typora/themes/base.user.css".text = import ../dot/typora.nix; + }; }; } diff --git a/configs/haskell.nix b/configs/haskell.nix new file mode 100644 index 0000000..c023e22 --- /dev/null +++ b/configs/haskell.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: +let + executables = pkgs.haskell.lib.justStaticExecutables; + haskells = import ../dot/haskells.nix; +in { + users.users.kfm.packages = with pkgs; [ + (haskellPackages.ghcWithHoogle haskells) + (executables haskellPackages.cabal-install) + (executables haskellPackages.ghcid) + (executables haskellPackages.hasktags) + (executables haskellPackages.hindent) + (executables haskellPackages.pointfree) + (executables haskellPackages.pointful) + (executables haskellPackages.hlint) + (executables haskellPackages.hpack) + ]; + + home-manager.users.kfm.home.file = { + ".ghc/ghci.conf".text = '' + :set editor vim + :def hoogle \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --count=15 \"" ++ s ++ "\"" + :def doc \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --info \"" ++ s ++ "\"" + :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\"" + :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\"" + :set prompt "\o033[1m%s\o033[1;34m λ\o033[0m " + ''; + ".stack/config.yaml".text = let user = config.constants.user; in '' + templates: + params: + author-name: ${user.name} + author-email: ${user.email} + copyright: 'Copyright: (c) 2018 ${user.name}' + github-username: ${user.github} + ''; + }; +} diff --git a/configs/kdeconnect.nix b/configs/kdeconnect.nix new file mode 100644 index 0000000..492028b --- /dev/null +++ b/configs/kdeconnect.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: +{ + # for kdeconnect + networking.firewall = { + allowedTCPPortRanges = [ { from = 1714; to = 1764; } ]; + allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; + }; + + home-manager.users.kfm = { + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; +} diff --git a/configs/networks.nix b/configs/networks.nix deleted file mode 100644 index c4e6a52..0000000 --- a/configs/networks.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ pkgs, config, lib, ... }: -let - sshPort = 22022; - secrets = import ../secrets.nix; -in { - networking.hosts = lib.mapAttrs (_: value: [ (value + ".local") ]) { - "192.168.178.1" = "router"; - "192.168.178.21" = "scardanelli"; - "192.168.178.22" = "homeros"; - "192.168.178.24" = "lestrade"; - "192.168.178.27" = "printer"; - } // { - "42:0:ca48:f98f:63d7:31ce:922b:245d" = [ "go" ]; - }; - - networking.wireless = { - enable = true; - userControlled.enable = true; - networks = { - Aether = { pskRaw = "e1b18af54036c5c9a747fe681c6a694636d60a5f8450f7dec0d76bc93e2ec85a"; }; - EasyBox-927376 = { pskRaw = "dbd490ab69b39bd67cfa06daf70fc3ef3ee90f482972a668ed758f90f5577c22"; }; - "Asoziales Netzwerk" = { pskRaw = "8e234041ec5f0cd1b6a14e9adeee9840ed51b2f18856a52137485523e46b0cb6"; }; - c-base-public = {}; - }; - }; - - # for kdeconnect - networking.firewall = { - allowedTCPPortRanges = [ { from = 1714; to = 1764; } ]; - allowedUDPPortRanges = [ { from = 1714; to = 1764; } ]; - }; - - home-manager.users.kfm = { - services.kdeconnect = { - enable = true; - indicator = true; - }; - - programs.ssh = { - enable = true; - matchBlocks = { - lestrade = { - hostname = "lestrade.local"; - user = "pi"; - }; - scardanelli = { - hostname = "scardanelli.local"; - user = "kfm"; - port = sshPort; - }; - homeros = { - hostname = "homeros.local"; - user = "kfm"; - port = sshPort; - }; - }; - }; - }; - - programs.ssh = { - startAgent = true; - forwardX11 = true; - }; - - services.openssh = { - ports = [ sshPort ]; - enable = true; - forwardX11 = true; - passwordAuthentication = false; - }; - - users.users.kfm.openssh.authorizedKeys.keys = let sshKey = secrets.ssh.publicKey; in [ - sshKey.homeros - sshKey.scardanelli - ]; - - networking.retiolum = { - scardanelli = { - ipv4 = "10.243.2.2"; - ipv6 = "42:0:3c46:4007:5bce:f1bc:606b:2b18"; - }; - homeros = { - ipv4 = "10.243.2.1"; - ipv6 = "42:0:3c46:53e:e63d:e62a:56ea:c705"; - }; - }.${config.networking.hostName}; - - environment.etc."tinc/retiolum/rsa_key.priv" = { - text = secrets.retiolum.privateKey.${config.networking.hostName}; - mode = "400"; - }; -} diff --git a/configs/packages.nix b/configs/packages.nix deleted file mode 100644 index b6d4e29..0000000 --- a/configs/packages.nix +++ /dev/null @@ -1,181 +0,0 @@ -{ config, pkgs, lib, ... }: -let - scripts = import ../dot/scripts.nix { inherit pkgs lib; }; - daybook = pkgs.callPackage ../packages/daybook.nix {}; - iolanguage = pkgs.callPackage ../packages/iolanguage.nix {}; - todoist = pkgs.callPackage ../packages/todoist {}; - haskells = import ../dot/haskells.nix; - unstable = import {}; - executables = pkgs.haskell.lib.justStaticExecutables; -in with pkgs; -{ - nixpkgs.config.allowUnfree = true; - - fonts.enableDefaultFonts = true; - fonts.fonts = [ - cantarell-fonts - corefonts - eb-garamond - fira - libertine - lmodern - noto-fonts - powerline-fonts - roboto - xlibs.fontschumachermisc - ubuntu_font_family - ]; - - environment.systemPackages = [ - ] ++ [ # office - abiword - gnumeric - # typora - ] ++ [ # theme - config.constants.theme.gtk.package - config.constants.theme.icon.package - config.constants.theme.cursor.package - ] ++ [ # internet - aria2 - chromium - firefox - tor-browser-bundle-bin - thunderbird - w3m - wget - httpie - whois - ] ++ [ # media - ffmpeg - mpv - pamixer - pavucontrol - gthumb - imagemagick - sxiv - blueman - zathura - ] ++ [ # archive - unzip - unrar - p7zip - zip - ] ++ [ # monitor - htop - iotop - iftop - lsof - psmisc - ] ++ [ # shell - bat - dos2unix - fd - file - git - gitAndTools.hub - gitstats - manpages - patch - patchutils - posix_man_pages - most - ranger - ripgrep - rlwrap - tree - ] ++ [ # hardware - pmount - usbutils - pciutils - ] ++ [ # graphical - arandr - libnotify - xclip - xorg.xkill - wpa_supplicant_gui - ]; - - programs.command-not-found.enable = true; - programs.java = { - enable = true; - package = pkgs.openjdk; - }; - virtualisation.docker.enable = true; - services.urxvtd.enable = true; - services.dbus.packages = [ pkgs.gnome3.dconf ]; - - users.users.kfm.packages = scripts ++ [ - ] ++ [ # typesetting - (texlive.combine { - inherit (pkgs.texlive) scheme-full texdoc latex2e-help-texinfo; - pkgFilter = pkg: pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "latex2e-help-texinfo"; - }) - pandoc - (executables haskellPackages.pandoc-citeproc) - asciidoctor - ] ++ [ # programming - tokei - gnumake - cabal2nix - chicken - clojure - gcc - (haskellPackages.ghcWithHoogle haskells) - (executables haskellPackages.cabal-install) - (executables haskellPackages.ghcid) - (executables haskellPackages.hakyll) - (executables haskellPackages.hasktags) - (executables haskellPackages.hindent) - (executables haskellPackages.pointfree) - (executables haskellPackages.pointful) - (executables haskellPackages.hlint) - (executables haskellPackages.hpack) - htmlTidy - iolanguage - lua - mypy - nix-prefetch-git - nodejs - nodePackages.eslint - nodePackages.csslint - nodePackages.prettier - ocaml - python3 - python36Packages.black - python36Packages.flake8 - ruby - rustup - scala - shellcheck - ] ++ [ # media - audacity - calibre - inkscape - poppler_utils - spotify - youtubeDL - ] ++ [ # cloud - dropbox-cli - grive2 - seafile-client - ] ++ [ # math - bc - graphviz - maxima - ] ++ [ # shell - # todoist - aspell - aspellDicts.de - aspellDicts.en - aspellDicts.la - daybook - jo - jq - memo - par - qrencode - unstable.hledger - wordnet - xsv - ]; -} diff --git a/configs/retiolum.nix b/configs/retiolum.nix index 869b863..a07f53c 100644 --- a/configs/retiolum.nix +++ b/configs/retiolum.nix @@ -1,72 +1,25 @@ -{ config, pkgs, lib, ... }: -with lib; -let - netname = "retiolum"; - cfg = config.networking.retiolum; +{ config, pkgs, ... }: +let retiolumKey = (import ../secrets.nix).retiolum.privateKey; in { - options = { - networking.retiolum.ipv4 = mkOption { - type = types.str; - description = '' - own ipv4 address - ''; - }; - networking.retiolum.ipv6 = mkOption { - type = types.str; - description = '' - own ipv6 address - ''; - }; - networking.retiolum.nodename = mkOption { - type = types.str; - default = config.networking.hostName; - description = '' - tinc network name - ''; - }; - }; - config = { - services.tinc.networks.${netname} = { - name = cfg.nodename; - extraConfig = '' - LocalDiscovery = yes - ConnectTo = gum - ConnectTo = ni - ConnectTo = prism - ConnectTo = eve - AutoConnect = yes - ''; - }; + imports = [ ../modules/retiolum.nix ]; - networking.extraHosts = builtins.readFile (pkgs.fetchurl { - name = "retiolum.hosts"; - url = "https://lassul.us/retiolum.hosts"; - # FIXME - sha256 = "0q8f5gw12hf9dhwcs4fni8jrvb2a1g6jskz28qcbd10p2xlkja58"; - }); - - environment.systemPackages = [ config.services.tinc.networks.${netname}.package ]; - - systemd.services."tinc.${netname}" = { - path = with pkgs; [ curl gnutar bzip2 ]; - preStart = '' - curl https://lassul.us/retiolum-hosts.tar.bz2 | tar -xjvf - -C /etc/tinc/${netname}/ || true - ''; - }; - - networking.firewall.allowedTCPPorts = [ 655 ]; - networking.firewall.allowedUDPPorts = [ 655 ]; - - systemd.network.enable = true; - systemd.network.networks = { - "${netname}".extraConfig = '' - [Match] - Name = tinc.${netname} - [Network] - Address=${cfg.ipv4}/12 - Address=${cfg.ipv6}/16 - ''; - }; + networking.hosts = { + "42:0:ca48:f98f:63d7:31ce:922b:245d" = [ "go" ]; }; + networking.retiolum = { + scardanelli = { + ipv4 = "10.243.2.2"; + ipv6 = "42:0:3c46:4007:5bce:f1bc:606b:2b18"; + }; + homeros = { + ipv4 = "10.243.2.1"; + ipv6 = "42:0:3c46:53e:e63d:e62a:56ea:c705"; + }; + }.${config.networking.hostName}; + + environment.etc."tinc/retiolum/rsa_key.priv" = { + text = retiolumKey.${config.networking.hostName}; + mode = "400"; + }; } diff --git a/configs/wifi.nix b/configs/wifi.nix new file mode 100644 index 0000000..350a90d --- /dev/null +++ b/configs/wifi.nix @@ -0,0 +1,13 @@ +{ config, ... }: +{ + networking.wireless = { + enable = true; + userControlled.enable = true; + networks = { + Aether = { pskRaw = "e1b18af54036c5c9a747fe681c6a694636d60a5f8450f7dec0d76bc93e2ec85a"; }; + EasyBox-927376 = { pskRaw = "dbd490ab69b39bd67cfa06daf70fc3ef3ee90f482972a668ed758f90f5577c22"; }; + "Asoziales Netzwerk" = { pskRaw = "8e234041ec5f0cd1b6a14e9adeee9840ed51b2f18856a52137485523e46b0cb6"; }; + c-base-public = {}; + }; + }; +} diff --git a/dot/ghci.nix b/dot/ghci.nix deleted file mode 100644 index 594fcf6..0000000 --- a/dot/ghci.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs }: -'' -:set editor vim -:def hoogle \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --count=15 \"" ++ s ++ "\"" -:def doc \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --info \"" ++ s ++ "\"" -:def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\"" -:def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\"" -:set prompt "\o033[1m%s\o033[1;34m λ\o033[0m " -'' -# :def djinn \x -> return $ ":!echo \"" ++ x ++ "\" | ${pkgs.haskell.packages.ghc7102.djinn}/bin/djinn /dev/stdin" diff --git a/dot/stack.nix b/dot/stack.nix deleted file mode 100644 index 9e3bc18..0000000 --- a/dot/stack.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ user }: -'' -templates: - params: - author-name: ${user.name} - author-email: ${user.email} - copyright: 'Copyright: (c) 2018 ${user.name}' - github-username: ${user.github} -'' diff --git a/helpers.nix b/helpers.nix deleted file mode 100644 index be82438..0000000 --- a/helpers.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - commaSep = builtins.concatStringsSep ","; -} diff --git a/modules/retiolum.nix b/modules/retiolum.nix new file mode 100644 index 0000000..869b863 --- /dev/null +++ b/modules/retiolum.nix @@ -0,0 +1,72 @@ +{ config, pkgs, lib, ... }: +with lib; +let + netname = "retiolum"; + cfg = config.networking.retiolum; +in { + options = { + networking.retiolum.ipv4 = mkOption { + type = types.str; + description = '' + own ipv4 address + ''; + }; + networking.retiolum.ipv6 = mkOption { + type = types.str; + description = '' + own ipv6 address + ''; + }; + networking.retiolum.nodename = mkOption { + type = types.str; + default = config.networking.hostName; + description = '' + tinc network name + ''; + }; + }; + config = { + services.tinc.networks.${netname} = { + name = cfg.nodename; + extraConfig = '' + LocalDiscovery = yes + ConnectTo = gum + ConnectTo = ni + ConnectTo = prism + ConnectTo = eve + AutoConnect = yes + ''; + }; + + networking.extraHosts = builtins.readFile (pkgs.fetchurl { + name = "retiolum.hosts"; + url = "https://lassul.us/retiolum.hosts"; + # FIXME + sha256 = "0q8f5gw12hf9dhwcs4fni8jrvb2a1g6jskz28qcbd10p2xlkja58"; + }); + + environment.systemPackages = [ config.services.tinc.networks.${netname}.package ]; + + systemd.services."tinc.${netname}" = { + path = with pkgs; [ curl gnutar bzip2 ]; + preStart = '' + curl https://lassul.us/retiolum-hosts.tar.bz2 | tar -xjvf - -C /etc/tinc/${netname}/ || true + ''; + }; + + networking.firewall.allowedTCPPorts = [ 655 ]; + networking.firewall.allowedUDPPorts = [ 655 ]; + + systemd.network.enable = true; + systemd.network.networks = { + "${netname}".extraConfig = '' + [Match] + Name = tinc.${netname} + [Network] + Address=${cfg.ipv4}/12 + Address=${cfg.ipv6}/16 + ''; + }; + }; + +} diff --git a/systems/homeros/config.nix b/systems/homeros/config.nix new file mode 100644 index 0000000..47c7c97 --- /dev/null +++ b/systems/homeros/config.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: +{ + imports = + [ ../regular.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "homeros"; + + system.stateVersion = "19.03"; +} diff --git a/systems/homeros/physical.nix b/systems/homeros/physical.nix new file mode 100644 index 0000000..a6c395b --- /dev/null +++ b/systems/homeros/physical.nix @@ -0,0 +1,32 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ./config.nix + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" "rtsx_usb_sdmmc" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/83544ad3-1d23-4c2d-82bc-fafef13a996f"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8F9E-7556"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/5ea3a65e-8fdb-45fb-ad32-3759d991a83a"; } + ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/systems/regular.nix b/systems/regular.nix new file mode 100644 index 0000000..5e7b4cc --- /dev/null +++ b/systems/regular.nix @@ -0,0 +1,82 @@ +{ config, lib, pkgs, ... }: +let + executables = pkgs.haskell.lib.justStaticExecutables; + unstable = import {}; + todoist = pkgs.callPackage ../packages/todoist {}; + daybook = pkgs.callPackage ../packages/daybook.nix {}; + iolanguage = pkgs.callPackage ../packages/iolanguage.nix {}; +in { + imports = [ + ../configs/base + ../configs/docker.nix + ../configs/google-drive.nix + ../configs/graphical.nix + ../configs/haskell.nix + ../configs/hu-berlin.nix + ../configs/retiolum.nix + ../configs/wifi.nix + ]; + + users.users.kfm.packages = with pkgs; [ + ] ++ [ # typesetting + (texlive.combine { + inherit (pkgs.texlive) scheme-full texdoc latex2e-help-texinfo; + pkgFilter = pkg: pkg.tlType == "run" || pkg.tlType == "bin" || pkg.pname == "latex2e-help-texinfo"; + }) + pandoc + (executables haskellPackages.pandoc-citeproc) + (executables haskellPackages.hakyll) + asciidoctor + ] ++ [ # programming + tokei + gnumake + cabal2nix + chicken + clojure + gcc + htmlTidy + iolanguage + lua + mypy + nix-prefetch-git + nodejs + nodePackages.eslint + nodePackages.csslint + nodePackages.prettier + ocaml + python3 + python36Packages.black + python36Packages.flake8 + ruby + rustup + scala + shellcheck + ] ++ [ # media + audacity + calibre + inkscape + poppler_utils + spotify + youtubeDL + ] ++ [ # cloud + dropbox-cli + grive2 + seafile-client + ] ++ [ # math + bc + graphviz + maxima + ] ++ [ # shell + # todoist + aspell + aspellDicts.de + aspellDicts.en + aspellDicts.la + daybook + memo + qrencode + unstable.hledger + wordnet + xsv + ]; +} diff --git a/systems/slim.nix b/systems/slim.nix new file mode 100644 index 0000000..a7505b5 --- /dev/null +++ b/systems/slim.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, ... }: +{ + imports = [ + ../configs/base + ]; +}