From 1da0bea837da91b9ce42f6ba94478e8ebda631ff Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 12 Jan 2022 11:51:56 +0100 Subject: [PATCH 1/5] Fixes to make pbp build again --- hosts/pbp/default.nix | 2 +- profiles/core/default.nix | 2 +- users/ccr/default.nix | 2 -- users/profiles/blender/default.nix | 2 ++ users/profiles/emacs/default.nix | 2 +- users/profiles/sway/default.nix | 4 ++-- users/profiles/vscode/default.nix | 5 +++-- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hosts/pbp/default.nix b/hosts/pbp/default.nix index 9f55f75..c160bfa 100644 --- a/hosts/pbp/default.nix +++ b/hosts/pbp/default.nix @@ -4,6 +4,6 @@ ./configuration.nix ] ++ suites.base; - bud.enable = true; + bud.enable = false; bud.localFlakeClone = "/home/ccr/fleet"; } diff --git a/profiles/core/default.nix b/profiles/core/default.nix index 4781df6..b63820f 100644 --- a/profiles/core/default.nix +++ b/profiles/core/default.nix @@ -26,7 +26,7 @@ in nix-index nmap ripgrep - skim + #skim tealdeer tmux usbutils diff --git a/users/ccr/default.nix b/users/ccr/default.nix index ad23f44..c0a6bcd 100644 --- a/users/ccr/default.nix +++ b/users/ccr/default.nix @@ -25,8 +25,6 @@ gphoto2 digikam rawtherapee - freecad - openscad deploy-rs.deploy-rs ] ++ (if !stdenv.hostPlatform.isAarch64 then [ wineWowPackages.full ] else [ ]) diff --git a/users/profiles/blender/default.nix b/users/profiles/blender/default.nix index 053d4bc..1f43e6b 100644 --- a/users/profiles/blender/default.nix +++ b/users/profiles/blender/default.nix @@ -1,8 +1,10 @@ { pkgs, ... }: { home.packages = with pkgs; [ + openscad ] ++ (if !stdenv.hostPlatform.isAarch64 then [ blender + freecad ] else [ ]); } diff --git a/users/profiles/emacs/default.nix b/users/profiles/emacs/default.nix index f3f63bd..1db6621 100644 --- a/users/profiles/emacs/default.nix +++ b/users/profiles/emacs/default.nix @@ -35,7 +35,6 @@ fd ffmpegthumbnailer graphviz-nox - haskell-language-server hunspell hunspellDicts.en_US hunspellDicts.it_IT @@ -59,6 +58,7 @@ ) ] ++ (if pkgs.system == "x86_64-linux" then [ python-language-server + haskell-language-server ] ++ (with easy-ps; [ # spago2nix nodejs diff --git a/users/profiles/sway/default.nix b/users/profiles/sway/default.nix index 5924a84..eae5662 100644 --- a/users/profiles/sway/default.nix +++ b/users/profiles/sway/default.nix @@ -57,8 +57,8 @@ ''; in lib.mkOptionDefault { - "${modifier}+x" = "exec ${pkgs.customEmacs}/bin/emacs"; - "${modifier}+b" = "exec ${pkgs.firefox}/bin/firefox"; + "${modifier}+x" = "exec emacs"; + "${modifier}+b" = "exec firefox"; "${modifier}+s" = "exec ${screenshotScript}"; }; }; diff --git a/users/profiles/vscode/default.nix b/users/profiles/vscode/default.nix index 5ffd529..a7cc608 100644 --- a/users/profiles/vscode/default.nix +++ b/users/profiles/vscode/default.nix @@ -29,8 +29,9 @@ }; home.packages = with pkgs; [ - haskell-language-server stylish-haskell ghc - ]; + ] ++ (if pkgs.system == "x86_64-linux" then [ + haskell-language-server + ] else [ ]); } From d0c42a5b7f981d6441bf79718cbce53ea3686ed4 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 12 Jan 2022 12:09:58 +0100 Subject: [PATCH 2/5] Nix store gc and Emacs as systemd service --- hosts/hs/configuration.nix | 8 ++++++++ hosts/mbp/configuration.nix | 7 +------ hosts/pbp/configuration.nix | 13 +++++++++++-- hosts/pc/configuration.nix | 8 ++++++++ users/profiles/emacs/default.nix | 4 ++++ users/profiles/sway/default.nix | 2 +- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/hosts/hs/configuration.nix b/hosts/hs/configuration.nix index 189aa6b..6a28de3 100644 --- a/hosts/hs/configuration.nix +++ b/hosts/hs/configuration.nix @@ -259,6 +259,14 @@ email = "andrea.ciceri@autistici.org"; }; + nix = { + package = pkgs.nixUnstable; + gc = { + automatic = true; + options = "--delete-older-than 3d"; + }; + }; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/hosts/mbp/configuration.nix b/hosts/mbp/configuration.nix index 2d44543..d65ec92 100644 --- a/hosts/mbp/configuration.nix +++ b/hosts/mbp/configuration.nix @@ -18,13 +18,8 @@ nix = { package = pkgs.nixUnstable; - extraOptions = '' - experimental-features = nix-command flakes flakes ca-references - keep-derivations = true - keep-outputs = true - ''; gc = { - automatic = false; + automatic = true; user = "andreaciceri"; options = "--delete-older-than 3d"; }; diff --git a/hosts/pbp/configuration.nix b/hosts/pbp/configuration.nix index 79d2776..4e15786 100644 --- a/hosts/pbp/configuration.nix +++ b/hosts/pbp/configuration.nix @@ -6,7 +6,7 @@ boot = { initrd.availableKernelModules = [ "usbhid" ]; kernelPackages = pbpKernelLatest; - kernelModules = []; + kernelModules = [ ]; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; @@ -45,7 +45,16 @@ }; swapDevices = - [ { device = "/dev/disk/by-uuid/e236d328-496e-4cf8-ba54-857789ca258f"; } ]; + [{ device = "/dev/disk/by-uuid/e236d328-496e-4cf8-ba54-857789ca258f"; }]; + + + nix = { + package = pkgs.nixUnstable; + gc = { + automatic = true; + options = "--delete-older-than 3d"; + }; + }; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; } diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index ee0d07b..b57e8f5 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -43,5 +43,13 @@ swapDevices = [{ device = "/dev/disk/by-label/swap"; }]; + nix = { + package = pkgs.nixUnstable; + gc = { + automatic = true; + options = "--delete-older-than 3d"; + }; + }; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/users/profiles/emacs/default.nix b/users/profiles/emacs/default.nix index 1db6621..be92959 100644 --- a/users/profiles/emacs/default.nix +++ b/users/profiles/emacs/default.nix @@ -11,6 +11,10 @@ package = pkgs.customEmacs; }; + services.emacs = { + enable = true; + }; + # For some reason Hunspell dictionaries paths must be specified on Darwin home.sessionVariables = if pkgs.stdenv.hostPlatform.isDarwin then { diff --git a/users/profiles/sway/default.nix b/users/profiles/sway/default.nix index eae5662..88b9dfc 100644 --- a/users/profiles/sway/default.nix +++ b/users/profiles/sway/default.nix @@ -57,7 +57,7 @@ ''; in lib.mkOptionDefault { - "${modifier}+x" = "exec emacs"; + "${modifier}+x" = "exec emacsclient -c"; "${modifier}+b" = "exec firefox"; "${modifier}+s" = "exec ${screenshotScript}"; }; From 4a657d52f5ac6c04bc3ce19eae8d4210e1087fbf Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 19 Jan 2022 00:14:50 +0100 Subject: [PATCH 3/5] Testing `syntching` (if works, refactoring needed) --- hosts/hs/configuration.nix | 32 +++++++++++++++++++++++++++++++- hosts/pbp/configuration.nix | 17 +++++++++++++++++ hosts/pc/configuration.nix | 17 +++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/hosts/hs/configuration.nix b/hosts/hs/configuration.nix index 6a28de3..bc4f7d3 100644 --- a/hosts/hs/configuration.nix +++ b/hosts/hs/configuration.nix @@ -165,10 +165,40 @@ guiAddress = "0.0.0.0:8384"; dataDir = "/mnt/archivio/syncthing"; user = "ccr"; + devices = { + oneplus5t = { + id = "IUETIK2-LBTIIKO-GTZXVMA-LEDFK5I-F2M7JKX-76OUDJL-QRJ62J4-5DYYIAI"; + }; + pc = { + id = "VI4CPQE-PTRRBQQ-LQVG3SE-7BVHQC2-TT4TIP7-L3OBXQR-AWLZVCO-GVPQUQG"; + }; + }; + folders = { + "/mnt/archivio/syncthing/camera" = { + id = "camera"; + devices = [ "oneplus5t" ]; + }; + "/mnt/archivio/syncthing/orgzly" = { + id = "orgzly"; + devices = [ "oneplus5t" "pc" ]; + }; + "/mnt/archivio/syncthing/roam" = { + id = "roam"; + devices = [ "oneplus5t" "pc" ]; + }; + "/mnt/archivio/syncthing/whatsapp" = { + id = "whatsapp"; + devices = [ "oneplus5t" ]; + }; + "/mnt/archivio/syncthing/calls" = { + id = "calls"; + devices = [ "oneplus5t" ]; + }; + }; }; navidrome = { - enable = true; + enable = false; settings = { Address = "0.0.0.0"; Port = 9093; diff --git a/hosts/pbp/configuration.nix b/hosts/pbp/configuration.nix index 4e15786..717340e 100644 --- a/hosts/pbp/configuration.nix +++ b/hosts/pbp/configuration.nix @@ -56,5 +56,22 @@ }; }; + services.syncthing = { + enable = true; + guiAddress = "127.0.0.1:8384"; + dataDir = "/home/ccr/syncthing"; + user = "ccr"; + folders = { + "orgzly" = { + id = "orgzly"; + path = "/home/ccr/orgzly"; + }; + "roam" = { + id = "roam"; + path = "/home/ccr/roam"; + }; + }; + }; + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; } diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index b57e8f5..ef2520e 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -51,5 +51,22 @@ }; }; + services.syncthing = { + enable = true; + guiAddress = "127.0.0.1:8384"; + dataDir = "/home/ccr/syncthing"; + user = "ccr"; + folders = { + "orgzly" = { + id = "orgzly"; + path = "/home/ccr/orgzly"; + }; + "roam" = { + id = "roam"; + path = "/home/ccr/roam"; + }; + }; + }; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } From 63ee0f120903f863f78096d70a5964f494c0c4ff Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 19 Jan 2022 13:07:50 +0100 Subject: [PATCH 4/5] `syntching` testing and `qmk` --- flake.nix | 2 +- hosts/hs/configuration.nix | 13 ------------- hosts/pbp/configuration.nix | 19 +------------------ hosts/pc/configuration.nix | 19 +------------------ profiles/syncthing/default.nix | 8 ++++++++ users/profiles/qmk/default.nix | 5 +++++ 6 files changed, 16 insertions(+), 50 deletions(-) create mode 100644 profiles/syncthing/default.nix create mode 100644 users/profiles/qmk/default.nix diff --git a/flake.nix b/flake.nix index 3cf0044..af949b0 100644 --- a/flake.nix +++ b/flake.nix @@ -168,7 +168,7 @@ gui = [ sway xdg gtk foot bat ]; browser = [ firefox chromium qutebrowser tor-browser ]; multimedia = [ mpv zathura ]; - dev = [ vim emacs vscode lorri direnv ]; + dev = [ vim emacs vscode lorri direnv qmk ]; modelling = [ blender cura ]; }; }; diff --git a/hosts/hs/configuration.nix b/hosts/hs/configuration.nix index bc4f7d3..0986de2 100644 --- a/hosts/hs/configuration.nix +++ b/hosts/hs/configuration.nix @@ -165,34 +165,21 @@ guiAddress = "0.0.0.0:8384"; dataDir = "/mnt/archivio/syncthing"; user = "ccr"; - devices = { - oneplus5t = { - id = "IUETIK2-LBTIIKO-GTZXVMA-LEDFK5I-F2M7JKX-76OUDJL-QRJ62J4-5DYYIAI"; - }; - pc = { - id = "VI4CPQE-PTRRBQQ-LQVG3SE-7BVHQC2-TT4TIP7-L3OBXQR-AWLZVCO-GVPQUQG"; - }; - }; folders = { "/mnt/archivio/syncthing/camera" = { id = "camera"; - devices = [ "oneplus5t" ]; }; "/mnt/archivio/syncthing/orgzly" = { id = "orgzly"; - devices = [ "oneplus5t" "pc" ]; }; "/mnt/archivio/syncthing/roam" = { id = "roam"; - devices = [ "oneplus5t" "pc" ]; }; "/mnt/archivio/syncthing/whatsapp" = { id = "whatsapp"; - devices = [ "oneplus5t" ]; }; "/mnt/archivio/syncthing/calls" = { id = "calls"; - devices = [ "oneplus5t" ]; }; }; }; diff --git a/hosts/pbp/configuration.nix b/hosts/pbp/configuration.nix index 717340e..33fde87 100644 --- a/hosts/pbp/configuration.nix +++ b/hosts/pbp/configuration.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, profiles, pbpKernelLatest, ... }: { - imports = with profiles; [ mount-nas sshd dbus avahi printing xdg ]; + imports = with profiles; [ mount-nas sshd dbus avahi printing xdg syncthing ]; boot = { initrd.availableKernelModules = [ "usbhid" ]; @@ -56,22 +56,5 @@ }; }; - services.syncthing = { - enable = true; - guiAddress = "127.0.0.1:8384"; - dataDir = "/home/ccr/syncthing"; - user = "ccr"; - folders = { - "orgzly" = { - id = "orgzly"; - path = "/home/ccr/orgzly"; - }; - "roam" = { - id = "roam"; - path = "/home/ccr/roam"; - }; - }; - }; - powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; } diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix index ef2520e..c5a534c 100644 --- a/hosts/pc/configuration.nix +++ b/hosts/pc/configuration.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, profiles, ... }: { - imports = with profiles; [ mount-nas sshd dbus avahi printing xdg docker adb ]; + imports = with profiles; [ mount-nas sshd dbus avahi printing xdg docker adb syncthing ]; boot = { initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; @@ -51,22 +51,5 @@ }; }; - services.syncthing = { - enable = true; - guiAddress = "127.0.0.1:8384"; - dataDir = "/home/ccr/syncthing"; - user = "ccr"; - folders = { - "orgzly" = { - id = "orgzly"; - path = "/home/ccr/orgzly"; - }; - "roam" = { - id = "roam"; - path = "/home/ccr/roam"; - }; - }; - }; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; } diff --git a/profiles/syncthing/default.nix b/profiles/syncthing/default.nix new file mode 100644 index 0000000..7135c21 --- /dev/null +++ b/profiles/syncthing/default.nix @@ -0,0 +1,8 @@ +{ + services.syncthing = { + enable = true; + guiAddress = "127.0.0.1:8384"; + dataDir = "/home/ccr/syncthing"; + user = "ccr"; + }; +} diff --git a/users/profiles/qmk/default.nix b/users/profiles/qmk/default.nix new file mode 100644 index 0000000..887ddbc --- /dev/null +++ b/users/profiles/qmk/default.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: with pkgs; { + + home.packages = [ qmk ]; + +} From c1dd461b6dae93e1827b4f37e01f91fb3386561d Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 19 Jan 2022 13:14:10 +0100 Subject: [PATCH 5/5] Disabled lockfiles --- users/profiles/emacs/emacs.d/config/config-emacs.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/users/profiles/emacs/emacs.d/config/config-emacs.el b/users/profiles/emacs/emacs.d/config/config-emacs.el index 2589e26..fe80404 100644 --- a/users/profiles/emacs/emacs.d/config/config-emacs.el +++ b/users/profiles/emacs/emacs.d/config/config-emacs.el @@ -2,6 +2,7 @@ backup-by-copying t delete-old-versions 6 kept-old-versions 2 - version-control t) + version-control t + create-lockfiles nil) (provide 'config-emacs)