diff --git a/README.md b/README.md index 0f441dcd..48bf5c33 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ To provision a new host: To rebuild a host: -* run `,/nyx build ` where method is optional, can be... switch or boot or such. +* run `./nyx build ` where method is optional, can be... switch or boot or such. diff --git a/config/hosts/athame/nextcloud.nix b/config/hosts/athame/nextcloud.nix index de665e86..4b43edf6 100644 --- a/config/hosts/athame/nextcloud.nix +++ b/config/hosts/athame/nextcloud.nix @@ -9,7 +9,7 @@ services.nextcloud = { enable = true; hostName = "files.kittywit.ch"; - package = pkgs.nextcloud20; + package = pkgs.nextcloud21; https = true; config = { dbtype = "pgsql"; diff --git a/config/profiles/common/nixos/nix.nix b/config/profiles/common/nixos/nix.nix index 0fc808e7..61cdbe0d 100644 --- a/config/profiles/common/nixos/nix.nix +++ b/config/profiles/common/nixos/nix.nix @@ -7,15 +7,16 @@ nixpkgs.config = { allowUnfree = true; }; nix = { nixPath = [ - "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos" + "nixpkgs=${sources.nixpkgs}" "nixpkgs-unstable=${sources.nixpkgs-unstable}" "nixpkgs-mozilla=${sources.nixpkgs-mozilla}" "NUR=${sources.NUR}" "arc=${sources.arc-nixexprs}" ]; - binaryCaches = [ "https://cache.nixos.org" "https://arc.cachix.org" ]; + binaryCaches = [ "https://arc.cachix.org" ]; binaryCachePublicKeys = [ "arc.cachix.org-1:DZmhclLkB6UO0rc0rBzNpwFbbaeLfyn+fYccuAy7YVY=" ]; + }; gc.automatic = lib.mkDefault true; gc.options = lib.mkDefault "--delete-older-than 1w"; trustedUsers = [ "root" "@wheel" ]; diff --git a/config/profiles/common/nixos/packages.nix b/config/profiles/common/nixos/packages.nix index c6537757..ed328351 100644 --- a/config/profiles/common/nixos/packages.nix +++ b/config/profiles/common/nixos/packages.nix @@ -9,7 +9,6 @@ cachix ripgrep git - kitty.terminfo nixfmt mprime wget diff --git a/config/profiles/gui/home/kitty.nix b/config/profiles/gui/home/kitty.nix index 62588445..af272955 100644 --- a/config/profiles/gui/home/kitty.nix +++ b/config/profiles/gui/home/kitty.nix @@ -2,8 +2,6 @@ { config = lib.mkIf config.deploy.profile.gui { - home.sessionVariables.TERMINFO_DIRS = - "${pkgs.kitty.terminfo.outPath}/share/terminfo"; programs.kitty = { enable = true; font.name = witch.style.font.name; diff --git a/config/profiles/gui/home/packages.nix b/config/profiles/gui/home/packages.nix index 06e2f29f..4ed2c843 100644 --- a/config/profiles/gui/home/packages.nix +++ b/config/profiles/gui/home/packages.nix @@ -9,6 +9,7 @@ element-desktop mumble obs-studio + niv xfce.ristretto audacity avidemux @@ -23,7 +24,7 @@ lm_sensors baresip psmisc - unstable.discord + discord tdesktop yubikey-manager pinentry.gtk2 diff --git a/config/profiles/kat/home/default.nix b/config/profiles/kat/home/default.nix index 2d4dbf56..275a58cd 100644 --- a/config/profiles/kat/home/default.nix +++ b/config/profiles/kat/home/default.nix @@ -1,5 +1,5 @@ { ... }: { - imports = [ ./shell.nix ./git.nix ./tmux.nix ./ssh.nix ./emacs ]; + imports = [ ./shell.nix ./git.nix ./tmux.nix ./ssh.nix ./emacs ./packages.nix ]; } diff --git a/config/profiles/kat/home/packages.nix b/config/profiles/kat/home/packages.nix new file mode 100644 index 00000000..ccd4dfcb --- /dev/null +++ b/config/profiles/kat/home/packages.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, ... }: + +{ + config = lib.mkIf config.deploy.profile.kat { + home.packages = with pkgs; [ + kitty.terminfo + ]; + }; +} \ No newline at end of file diff --git a/config/profiles/sway/home/waybar/default.nix b/config/profiles/sway/home/waybar/default.nix index bd9f560e..6a70176d 100644 --- a/config/profiles/sway/home/waybar/default.nix +++ b/config/profiles/sway/home/waybar/default.nix @@ -10,7 +10,7 @@ }; settings = [{ modules-left = [ "sway/workspaces" "sway/mode" "sway/window" ]; - modules-center = [ "clock" ]; # "custom/weather" + modules-center = [ "clock" "custom/weather" ]; modules-right = [ "pulseaudio" "network" @@ -29,6 +29,12 @@ # on-click = "xdg-open 'https://google.com/search?q=weather'"; # exec = "nix-shell --command 'python ${../../../../../scripts/weather/weather.py} ${witch.secrets.profiles.sway.city} ${witch.secrets.profiles.sway.api_key}' ${../../../../../scripts/weather}"; #}; + "custom/weather" = { + format = "{}"; + interval = 3600; + on-click = "xdg-open 'https://google.com/search?q=weather'"; + exec = "${pkgs.kat-weather}/bin/kat-weather ${witch.secrets.profiles.sway.city} ${witch.secrets.profiles.sway.api_key}"; + }; cpu = { format = " {usage}%"; }; memory = { format = " {percentage}%"; }; temperature = { format = "﨎 {temperatureC}°C"; }; diff --git a/nix/sources.json b/nix/sources.json index dbeb3a57..88d69ece 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://nur.nix-community.org/", "owner": "nix-community", "repo": "NUR", - "rev": "1e426b00352d686ed9f9b94910b54b0036474bdd", - "sha256": "0gb5arxjm9shilvg0h410gwppbmf7l3bijrc0ydnlki70ab40v8k", + "rev": "94e3d90e9d8c642e2a2eb484aa4e595406ec181d", + "sha256": "1nricxq1z81k9zff1npapw68z5a68h8flj925b86djkx0d4faki2", "type": "tarball", - "url": "https://github.com/nix-community/NUR/archive/1e426b00352d686ed9f9b94910b54b0036474bdd.tar.gz", + "url": "https://github.com/nix-community/NUR/archive/94e3d90e9d8c642e2a2eb484aa4e595406ec181d.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "arc-nixexprs": { @@ -69,15 +69,15 @@ "url_template": "/-/archive/.tar.gz" }, "nixpkgs": { - "branch": "release-20.09", + "branch": "nixos-20.09", "description": "Nix Packages collection", "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "d284abb4df2ed8903cc8133de89cc327fb42b50b", - "sha256": "0hpdx2lc6cs5yl7qa1w55g4w1d492ga9xm0qsn42r2lm89d628ym", + "rev": "1ac507ba981970c8e864624542e31eb1f4049751", + "sha256": "1r05lrkvmjhygpmxj4h0rmvz53c7zmy5lff5az09bi1nwqm1xr42", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/d284abb4df2ed8903cc8133de89cc327fb42b50b.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/1ac507ba981970c8e864624542e31eb1f4049751.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-mozilla": { @@ -98,10 +98,10 @@ "homepage": "", "owner": "nixos", "repo": "nixpkgs", - "rev": "e061350a361df9667490c5914fb72a58dd927bca", - "sha256": "04lqpi25fkyzqflih3hixrrrbjv733mh1izgw4n03ar08w6dnm4k", + "rev": "8edfe0a2e8bfc750f7ac2818b2a4f364124806b6", + "sha256": "0ya2j4wg4v8j99rf98yfzsswqf3ydl49cdsm779z778cak4g7d7f", "type": "tarball", - "url": "https://github.com/nixos/nixpkgs/archive/e061350a361df9667490c5914fb72a58dd927bca.tar.gz", + "url": "https://github.com/nixos/nixpkgs/archive/8edfe0a2e8bfc750f7ac2818b2a4f364124806b6.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "pbb-nixfiles": { diff --git a/pkgs/default.nix b/pkgs/default.nix index 0c69b311..49cfa025 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,13 +1,14 @@ { config ? { }, sources, system ? builtins.currentSystem, ... }@args: let - pkgs = import sources.nixpkgs args; + pkgs = import sources.nixpkgs { inherit config; }; + overlay = self: super: rec { dino = super.callPackage "${sources.qyliss-nixlib}/overlays/patches/dino" { inherit (super) dino; }; - - discord = super.discord.override { nss = self.nss_latest; }; + + discord = unstable.discord.override { nss = self.nss_latest; }; arc = import sources.arc-nixexprs { pkgs = super; }; unstable = import sources.nixpkgs-unstable { inherit (self) config; }; @@ -18,6 +19,8 @@ let screenstub = unstable.callPackage ./screenstub { }; + kat-weather = super.callPackage ./kat-weather { }; + linuxPackagesFor = kernel: (super.linuxPackagesFor kernel).extend (_: ksuper: { vendor-reset = diff --git a/pkgs/kat-weather/default.nix b/pkgs/kat-weather/default.nix new file mode 100644 index 00000000..26a1ded2 --- /dev/null +++ b/pkgs/kat-weather/default.nix @@ -0,0 +1,16 @@ +{ lib, stdenv, fetchurl, python36, pythonPackages, installShellFiles }: + +stdenv.mkDerivation { + name = "kat-weather"; + buildInputs = [ + (python36.withPackages (pythonPackages: with pythonPackages; [ + requests + ])) + ]; + unpackPhase = "true"; + installPhase = '' + mkdir -p $out/bin + cp ${./weather.py} $out/bin/kat-weather + chmod +x $out/bin/kat-weather + ''; +} \ No newline at end of file diff --git a/scripts/weather/weather.py b/pkgs/kat-weather/weather.py similarity index 98% rename from scripts/weather/weather.py rename to pkgs/kat-weather/weather.py index d0454ee3..6def3c80 100644 --- a/scripts/weather/weather.py +++ b/pkgs/kat-weather/weather.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import requests import json import sys diff --git a/scripts/weather/default.nix b/scripts/weather/default.nix deleted file mode 100644 index 82e708ec..00000000 --- a/scripts/weather/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs ? import { } }: - -with pkgs; - -mkShell { - buildInputs = [ pkgs.python3 pkgs.python3.pkgs.requests ]; - shellHook = '' - # Tells pip to put packages into $PIP_PREFIX instead of the usual locations. - # See https://pip.pypa.io/en/stable/user_guide/#environment-variables. - export PIP_PREFIX=$(pwd)/_build/pip_packages - export PYTHONPATH="$PIP_PREFIX/${pkgs.python3.sitePackages}:$PYTHONPATH" - export PATH="$PIP_PREFIX/bin:$PATH" - unset SOURCE_DATE_EPOCH - ''; -}