Various changes

- `hs` host
  - cam subdomain behind reverse proxy
  - dynamic dns updater script
- `pc` host
  - ext4 instead of btrfs
  - ca-derivations experimental feature
- nix from unstable channel (2.8)
- cura from stable (unstable went broken)
- Emacs
  - company-nixos-options
  - helm-nixos-options
  - nix-modeline
  - disable format hook on save for nix mode
- nix from master (only in overlay, not used)
- bat (alias for cat)
- batman (alias for batman)
- disabled weird extra options for nix I couldn't even remember of
- Fira Code for sway/waybar
- New plain style for waybar
This commit is contained in:
Andrea Ciceri 2022-05-14 00:01:08 +02:00
parent 23b4989e7f
commit 8b80ba24c2
No known key found for this signature in database
GPG key ID: A1FC89532D1C5654
13 changed files with 105 additions and 183 deletions

2
.gitignore vendored
View file

@ -10,3 +10,5 @@ doi
pkgs/_sources/.shake*
*.qcow2
profiles/cachix/mlabs.nix

12
flake.lock generated
View file

@ -329,11 +329,11 @@
},
"nixpkgsDevInput": {
"locked": {
"lastModified": 1650450000,
"narHash": "sha256-/ASymH28AS7KsNvkQ1RMKRoCQKSi1AsWkHdJpQwhXCg=",
"lastModified": 1650581082,
"narHash": "sha256-aq5jnmGhP0hSXYozkxUKpgSZILvDobxB976JZFG6If8=",
"owner": "aciceri",
"repo": "nixpkgs",
"rev": "cf941213b48d9602be0dc2656e02e065740798ab",
"rev": "24b40a255c6adc6ab32c69737e8b4cfc50d8c8b4",
"type": "github"
},
"original": {
@ -459,11 +459,11 @@
},
"unstable": {
"locked": {
"lastModified": 1650161686,
"narHash": "sha256-70ZWAlOQ9nAZ08OU6WY7n4Ij2kOO199dLfNlvO/+pf8=",
"lastModified": 1652172129,
"narHash": "sha256-8e2JMrswaKe02P8rYfvIMoc59pNuw6h/GYu8DBE1c+0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1ffba9f2f683063c2b14c9f4d12c55ad5f4ed887",
"rev": "f419dc5763c2b3c5580e396dea065b6d8b58ee27",
"type": "github"
},
"original": {

View file

@ -210,9 +210,7 @@
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
'';
virtualHosts = {
"torrent.ccr.ydns.eu" = {
enableACME = true;
forceSSL = true;
locations."/" = {
@ -252,10 +250,55 @@
proxyPass = "http://192.168.1.71:80";
};
};
"cam.ccr.ydns.eu" = {
enableACME = true;
addSSL = true;
locations."/" = {
proxyPass = "http://192.168.1.80:80";
};
};
};
};
};
systemd.services.ydns =
let
ydnsUpdater = pkgs.writeScriptBin "ydnsUpdater" ''
#!${pkgs.stdenv.shell}
USER="andrea.ciceri@autistici.org"
PASSWORD=$(${pkgs.stdenv}/bin/cat /home/ccr/.ydns-password)
DOMAIN="ccr.ydns.eu"
for SUBDOMAIN in "books" "music" "sync" "torrent" "gate" "cam"
do
HOST="$SUBDOMAIN.$DOMAIN"
${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$HOST
done
${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$DOMAIN
'';
in
{
description = "YDNS IP updater";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
User = "ccr";
Type = "oneshot";
ExecStart = "${ydnsUpdater}/bin/ydnsUpdater";
};
};
systemd.timers.ydnsUpdater = {
wantedBy = [ "timers.target" ];
partOf = [ "ydnsUpdater.service" ];
timerConfig = {
OnCalendar = "*-*-* *:00:00"; # hourly
Unit = "ydnsUpdater.service";
};
};
networking.firewall = {
enable = true;
allowPing = true;

View file

@ -38,7 +38,13 @@
fileSystems."/" =
{
device = "/dev/disk/by-label/nixos";
fsType = "btrfs";
fsType = "ext4";
};
fileSystems."/home" =
{
device = "/dev/disk/by-label/home";
fsType = "ext4";
};
swapDevices =
@ -49,15 +55,16 @@
automatic = true;
options = "--delete-older-than 3d";
};
# package = pkgs.nixFromMaster;
package = pkgs.nix; # currently from unstable through an overlay
extraOptions = ''
experimental-features = ca-derivations
'';
};
networking.firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [
5900 # vnc
];
};
# TODO: disable, only for playing

View file

@ -17,7 +17,7 @@ in
customEmacs = prev.callPackage (import ./emacs) { };
amule = prev.callPackage (import ./amule) { };
digikam = nixpkgsUnstable.digikam;
cura = nixpkgsUnstable.cura;
#cura = nixpkgsUnstable.cura;
qutebrowser = import ./qutebrowser { pkgs = prev; };
#firefox-unwrapped = nixpkgsUnstable.firefox-unwrapped;
xdg-desktop-portal = nixpkgsUnstable.xdg-desktop-portal;
@ -30,5 +30,7 @@ in
v4l2loopback-dc = prev.callPackage (import ./v4l2loopback-dc) { kernel = prev.linux; };
slack = import ./slack { pkgs = prev; };
google-chrome = import ./google-chrome { pkgs = prev; };
nixFromMaster = import ./nix-from-master { nix = nixpkgsUnstable.nix; pkgs = prev; };
nix = nixpkgsUnstable.nix;
# then, call packages with `final.callPackage`
}

View file

@ -12,6 +12,7 @@ emacsWithPackages (
aggressive-indent
all-the-icons
company
company-nixos-options
dap-mode
diff-hl
envrc
@ -25,6 +26,7 @@ emacsWithPackages (
helm
helm-ag
helm-company
helm-nixos-options
helm-projectile
lispy
lsp-haskell
@ -34,6 +36,8 @@ emacsWithPackages (
magit
magit-delta
nix-mode
nix-modeline
nixos-options
notmuch
org-download
org-fragtog

View file

@ -0,0 +1,9 @@
{ nix, pkgs }:
nix.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "3ec979fa902c49e975a9af7dc2792fb197030e04";
hash = "sha256-mpFR1OrjayyVe8LpxJVaTLVIPPeTSIu7SDz/wXP78Vg=";
};
})

View file

@ -0,0 +1,10 @@
{
nix = {
binaryCaches = [
"https://cache.ngi0.nixos.org/"
];
binaryCachePublicKeys = [
"cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="
];
};
}

View file

@ -8,6 +8,8 @@ in
environment = {
systemPackages = with pkgs; [
bat
bat-extras.batman
binutils
coreutils
curl
@ -58,12 +60,6 @@ in
useSandbox = true;
allowedUsers = [ "@wheel" ];
trustedUsers = [ "root" "@wheel" ];
extraOptions = ''
min-free = 536870912
keep-outputs = true
keep-derivations = true
fallback = true
'';
};
services.earlyoom.enable = true;

View file

@ -2,6 +2,7 @@
:init
(setq company-backends '(company-capf
company-keywords
company-nixos-options
company-semantic
company-files
company-etags

View file

@ -1,7 +1,10 @@
(use-package nix-mode
:mode "\\.nix\\'"
:hook
(before-save . lsp-format-buffer))
;;:hook
;;(before-save . lsp-format-buffer)
)
(require 'sudo-utils)
(defun nixos-rebuild-switch ()

View file

@ -1,9 +1,6 @@
* {
border: none;
border-radius: 5;
/* `otf-font-awesome` is required to be installed for icons */
/* font matches sway-config.nix */
font-family: "DejaVu Sans";
font-family: "Fira Code";
font-weight: bold;
font-size: 9pt;
min-height: 0;
@ -17,40 +14,23 @@ window#waybar {
transition-duration: .5s;
}
window .modules-right * {
margin: 0 1rem;
}
window#waybar.hidden {
opacity: 0.2;
}
/*
window#waybar.empty {
background-color: transparent;
}
window#waybar.solo {
background-color: #FFFFFF;
}
*/
window#waybar.termite {
background-color: #3F3F3F;
}
window#waybar.chromium {
background-color: #000000;
border: none;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: #ffffff;
border-bottom: 3px solid transparent;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button:hover {
background: rgba(0, 0, 0, 0.2);
box-shadow: inherit;
border-bottom: 3px solid #ffffff;
}
#workspaces button.current_output {
@ -69,44 +49,7 @@ window#waybar.chromium {
background-color: #eb4d4b;
}
#mode {
background-color: #64727D;
border-bottom: 3px solid #ffffff;
}
#clock,
#battery,
#cpu,
#memory,
#temperature,
#backlight,
#network,
#pulseaudio,
#custom-media,
.srht-failed,
.srht-success,
#tray,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 10px;
margin: 0 4px;
color: #ffffff;
}
#clock {
background-color: #000000;
}
#battery {
background-color: #ffffff;
color: #000000;
}
#battery.charging {
color: #ffffff;
background-color: #26A65B;
}
@keyframes blink {
to {
@ -115,105 +58,6 @@ window#waybar.chromium {
}
}
#battery.critical:not(.charging) {
background-color: #f53c3c;
color: #ffffff;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
label:focus {
background-color: #000000;
}
#cpu {
background-color: #06989A;
}
#memory {
background-color: #2980b9;
}
#backlight {
background-color: #555753;
}
#network {
background-color: #4E9A06;
}
#network.disconnected {
background-color: #f53c3c;
}
#pulseaudio {
background-color: #75507B;
}
#pulseaudio.muted {
background-color: #90b1b1;
color: #2a5c45;
}
#custom-media {
background-color: #66cc99;
color: #2a5c45;
min-width: 100px;
}
#custom-media.custom-spotify {
background-color: #66cc99;
}
#custom-media.custom-vlc {
background-color: #ffa000;
}
#temperature {
background-color: #f0932b;
}
#temperature.critical {
background-color: #eb4d4b;
}
#tray {
background-color: #C4A000;
}
#idle_inhibitor {
background-color: #2d3436;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
}
#mpd {
background-color: #66cc99;
color: #2a5c45;
}
#mpd.disconnected {
background-color: #f53c3c;
}
#mpd.stopped {
background-color: #90b1b1;
}
#mpd.paused {
background-color: #51a37a;
}
.srht-success {
background-color: #4E9A06;
}
.srht-failed {
background-color: #f53c3c;
}

View file

@ -41,6 +41,7 @@
"pass-clone" = "[ -d .password-store ] && echo 'Password store archive already exists' || git clone git@git.sr.ht:~zrsk/pass ~/.password-store";
"getpass" = "pass show $(find .password-store/ -name \"*.gpg\" | sed \"s/\\.password-store\\/\\(.*\\)\\.gpg$/\\1/g\" | fzf) | wl-copy; ((sleep 60 && wl-copy --clear) &)";
"cat" = "bat";
"man" = "batman";
"em" = "[[ -z \$XDG_CURRENT_DESKTOP ]] && emacsclient -c -nw || emacsclient -c";
"emw" = "emacsclient -c";
"emnw" = "emacsclient -c -nw";