From 021ee17f1ba970054254b75e5249d076034b0afc Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 28 Dec 2022 17:26:53 +0100 Subject: [PATCH] Codroipo --- doom.d/config.el | 1 + doom.d/init.el | 2 +- flake.lock | 78 +++++++++++++++++++++++-- flake.nix | 15 ++++- hmModules/emacs/default.nix | 4 +- hmModules/git/default.nix | 1 + hmModules/shell/default.nix | 1 - hmModules/sway/default.nix | 6 +- hmModules/sway/waybar.nix | 1 + hosts/hs/default.nix | 6 +- hosts/rock5b/default.nix | 13 +++++ hosts/rock5b/hardware-configuration.nix | 15 +++++ hosts/thinkpad/default.nix | 2 + hosts/thinkpad/zfs.nix | 15 ++++- modules/nix-development/default.nix | 6 ++ secrets/default.nix | 1 + secrets/magit-forge-github-token.age | 18 ++++++ utils/default.nix | 6 ++ 18 files changed, 175 insertions(+), 16 deletions(-) create mode 100644 hosts/rock5b/default.nix create mode 100644 hosts/rock5b/hardware-configuration.nix create mode 100644 modules/nix-development/default.nix create mode 100644 secrets/magit-forge-github-token.age diff --git a/doom.d/config.el b/doom.d/config.el index dcfbe4c..53329fb 100644 --- a/doom.d/config.el +++ b/doom.d/config.el @@ -138,4 +138,5 @@ (after! eglot (add-to-list 'eglot-server-programs '(nix-mode . ("nil"))) + (add-hook! 'nix-mode-hook #'eglot-ensure) ) diff --git a/doom.d/init.el b/doom.d/init.el index a265686..b7efd8a 100644 --- a/doom.d/init.el +++ b/doom.d/init.el @@ -96,7 +96,7 @@ ;;gist ; interacting with github gists lookup ; navigate your code and its documentation lsp ; M-x vscode - magit ; a git porcelain for Emacs + (magit +forge) ; a git porcelain for Emacs make ; run make tasks from Emacs pass ; password manager for nerds ;;pdf ; pdf enhancements diff --git a/flake.lock b/flake.lock index d45c283..04181ad 100644 --- a/flake.lock +++ b/flake.lock @@ -226,6 +226,22 @@ "type": "github" } }, + "fan-control": { + "flake": false, + "locked": { + "lastModified": 1669548492, + "narHash": "sha256-qqPmOEF+r10VGz3izAnHZW6aJk1mOXy9BrpR9FvWSt0=", + "owner": "pymumu", + "repo": "fan-control-rock5b", + "rev": "8419990c6c0f47a3ed0b55255d7e3591cc5fdab9", + "type": "github" + }, + "original": { + "owner": "pymumu", + "repo": "fan-control-rock5b", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -363,6 +379,22 @@ "type": "github" } }, + "kernel-src": { + "flake": false, + "locked": { + "lastModified": 1670395302, + "narHash": "sha256-IZdeXSvGips2OPTwXljGPTeR2Kpx70NGQGF0Cd9xa+0=", + "owner": "radxa", + "repo": "kernel", + "rev": "ca15bbe36e6c087c96a603db7cc491a01d9a6467", + "type": "github" + }, + "original": { + "owner": "radxa", + "repo": "kernel", + "type": "github" + } + }, "naersk": { "inputs": { "nixpkgs": [ @@ -466,16 +498,15 @@ }, "nixpkgsUnstable": { "locked": { - "lastModified": 1670597555, - "narHash": "sha256-/k939P2S2246G6K5fyvC0U2IWvULhb4ZJg9K7ZxsX+k=", + "lastModified": 1672239721, + "narHash": "sha256-yGFJrTbRR/338y+UOvjRXi1pfidSdWb016UHOFFcfns=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2dea0f4c2d6e4603f54b2c56c22367e77869490c", + "rev": "4d5535c90c817917015bf26794d29802e254cb32", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -527,6 +558,22 @@ "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1656239181, + "narHash": "sha256-wW1xRFBn376yGloXZ4QzBE4hjipMawpV18Lshd9QSPw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5", + "type": "github" + } + }, "nose": { "flake": false, "locked": { @@ -661,6 +708,26 @@ "type": "github" } }, + "rock5b": { + "inputs": { + "fan-control": "fan-control", + "kernel-src": "kernel-src", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1672220053, + "narHash": "sha256-7LcL2J+5BIShEEjc7/gOKvDxvm+zKPHS2LQcDTQtQOA=", + "owner": "aciceri", + "repo": "rock5b-nixos", + "rev": "8b2f9583fa761f2013a9b20c15c8a621c1fd4a76", + "type": "github" + }, + "original": { + "owner": "aciceri", + "repo": "rock5b-nixos", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -670,7 +737,8 @@ "nixosHardware": "nixosHardware", "nixpkgsStable": "nixpkgsStable", "nixpkgsUnstable": "nixpkgsUnstable", - "preCommitHooks": "preCommitHooks" + "preCommitHooks": "preCommitHooks", + "rock5b": "rock5b" } }, "rotate-text": { diff --git a/flake.nix b/flake.nix index 78d5080..42a89fa 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "A complete, declarative, and reproducible configuration of my entire Nix fleet"; inputs = { - nixpkgsUnstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgsUnstable.url = "github:NixOS/nixpkgs"; nixpkgsStable.url = "github:NixOS/nixpkgs/nixos-22.05"; nixosHardware.url = "github:NixOS/nixos-hardware"; homeManager = { @@ -13,8 +13,8 @@ agenix.url = "github:ryantm/agenix"; doomEmacs.url = "github:nix-community/nix-doom-emacs"; comma.url = "github:nix-community/comma"; + rock5b.url = "github:aciceri/rock5b-nixos"; }; - outputs = {self, ...} @ inputs: let utils = import ./utils inputs; inherit @@ -41,4 +41,15 @@ inherit formatter; }; + + nixConfig = { + extra-substituters = [ + "https://aciceri-fleet.cachix.org" + "https://rock5b-nixos.cachix.org" + ]; + extra-trusted-public-keys = [ + "aciceri-fleet.cachix.org-1:e1AodrwmzRWy0eQi3lUY71M41fp9Sq+UpuKKv705xsI=" + "rock5b-nixos.cachix.org-1:bXHDewFS0d8pT90A+/YZan/3SjcyuPZ/QRgRSuhSPnA=" + ]; + }; } diff --git a/hmModules/emacs/default.nix b/hmModules/emacs/default.nix index 2cc2e7d..64f7ca2 100644 --- a/hmModules/emacs/default.nix +++ b/hmModules/emacs/default.nix @@ -4,8 +4,8 @@ lib, ... }: let - rev = "72a94f91fd0570556ce770dc3a39e658f7588f7e"; # Current master, Emacs 29, seems a good commit - sha256 = "e5kKIEZJB9BGbBvGtiPK3gNygFoGxkG02nRLCwnGtmk="; + rev = "2ddc480f4417775d6bf8ebcfc27b8cd7fa761a7d"; # Emacs 29, seems a good commit + sha256 = "sha256-SmtafhTYOI27/eraeaXwC1F09K+WNpjOy5WFu1h4QQg="; emacsMaster = (pkgs.emacs.override { nativeComp = true; diff --git a/hmModules/git/default.nix b/hmModules/git/default.nix index 0327947..419386f 100644 --- a/hmModules/git/default.nix +++ b/hmModules/git/default.nix @@ -12,6 +12,7 @@ in { ui.color = true; pull.rebase = false; rebase.autostash = true; + github.user = "aciceri"; }; userName = config.name; diff --git a/hmModules/shell/default.nix b/hmModules/shell/default.nix index e4dc04a..7289fcf 100644 --- a/hmModules/shell/default.nix +++ b/hmModules/shell/default.nix @@ -84,6 +84,5 @@ dig.dnsutils zsh-completions nix-zsh-completions - gnuapl ]; } diff --git a/hmModules/sway/default.nix b/hmModules/sway/default.nix index b2d3f59..47e485d 100644 --- a/hmModules/sway/default.nix +++ b/hmModules/sway/default.nix @@ -29,7 +29,6 @@ }; }; - # TODO check if it works (just wait?) services.swayidle.enable = true; wayland = { @@ -55,9 +54,14 @@ terminal = "footclient"; bars = [ { + mode = "hide"; + position = "top"; command = "${pkgs.waybar}/bin/waybar"; } ]; + gaps = { + smartBorders = "on"; + }; assigns = { "1" = [{title = ".*Mozilla Firefox$";} {title = ".*qutebrowser$";}]; "2" = [{title = "^((?!qutebrowser-editor).)*Emacs$";}]; diff --git a/hmModules/sway/waybar.nix b/hmModules/sway/waybar.nix index 9f9c875..f20e499 100644 --- a/hmModules/sway/waybar.nix +++ b/hmModules/sway/waybar.nix @@ -4,6 +4,7 @@ style = builtins.readFile ./style.css; settings = { mainBar = { + ipc = true; layer = "top"; position = "top"; height = 30; diff --git a/hosts/hs/default.nix b/hosts/hs/default.nix index ba3a3ed..d1bbafb 100644 --- a/hosts/hs/default.nix +++ b/hosts/hs/default.nix @@ -313,16 +313,18 @@ 139 # samba 443 # https 445 # samba + 4662 4712 # amule - 4711 # amule web gui 8384 # syncthing 53 # dns ]; allowedUDPPorts = [ - 137 # samba + 137 138 # samba 51820 # wireguard 53 # dns + 4665 + 4672 # amule ]; }; diff --git a/hosts/rock5b/default.nix b/hosts/rock5b/default.nix new file mode 100644 index 0000000..e63f604 --- /dev/null +++ b/hosts/rock5b/default.nix @@ -0,0 +1,13 @@ +{fleetModules, ...}: { + imports = + [ + ./hardware-configuration.nix + ] + ++ fleetModules [ + "common" + "ssh" + "ccr" + ]; + + ccr.enable = true; +} diff --git a/hosts/rock5b/hardware-configuration.nix b/hosts/rock5b/hardware-configuration.nix new file mode 100644 index 0000000..cf15a14 --- /dev/null +++ b/hosts/rock5b/hardware-configuration.nix @@ -0,0 +1,15 @@ +{lib, ...}: { + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXOS_ROOTFS"; + fsType = "ext4"; + }; + }; + + swapDevices = []; + + boot.loader = { + grub.enable = false; + generic-extlinux-compatible.enable = true; + }; +} diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 21e0ee6..6eac254 100644 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -28,6 +28,7 @@ "transmission" "udisks2" "xdg" + "nix-development" ]; ccr = { @@ -77,6 +78,7 @@ boot.initrd.kernelModules = []; boot.kernelModules = ["kvm-intel"]; boot.extraModulePackages = []; + boot.kernelPackages = pkgs.linuxPackages_zen; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/hosts/thinkpad/zfs.nix b/hosts/thinkpad/zfs.nix index 6c9832c..d336876 100644 --- a/hosts/thinkpad/zfs.nix +++ b/hosts/thinkpad/zfs.nix @@ -5,7 +5,6 @@ }: { boot.supportedFilesystems = ["zfs"]; networking.hostId = "adf0b5e7"; - boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; boot.loader.efi.efiSysMountPoint = "/boot/efi"; boot.loader.efi.canTouchEfiVariables = false; boot.loader.generationsDir.copyKernels = true; @@ -27,11 +26,23 @@ cp -r /boot/efi/EFI $ESP_MIRROR for i in /boot/efis/*; do cp -r $ESP_MIRROR/EFI $i - done + done wv rm -rf $ESP_MIRROR ''; boot.loader.grub.devices = [ "/dev/disk/by-id/nvme-INTEL_SSDPEKKF010T8L_PHHP938405741P0D" ]; users.users.root.initialHashedPassword = "$6$EqXfyFLxUZfpmJ8F$UH3pLcHwgLpOZwiSDhdq/iR/p.uyZZYlk6G4Q0S8BtYr3Qt2xKU56Fwv3Mgco.J0i3cx1Nm8XMfvythSuv8gh/"; + + # TODO: remove this when it will be no more necessary + boot.zfs.enableUnstable = true; + nixpkgs.overlays = [ + (self: super: { + linuxPackages_zen = super.linuxPackages_zen.extend (lpSelf: lpSuper: { + zfsUnstable = lpSuper.zfsUnstable.overrideAttrs (_: { + meta.broken = false; + }); + }); + }) + ]; } diff --git a/modules/nix-development/default.nix b/modules/nix-development/default.nix new file mode 100644 index 0000000..5551b46 --- /dev/null +++ b/modules/nix-development/default.nix @@ -0,0 +1,6 @@ +{ + nix.settings = { + keep-outputs = true; + keep-derivations = true; + }; +} diff --git a/secrets/default.nix b/secrets/default.nix index d1ec3f4..803273d 100644 --- a/secrets/default.nix +++ b/secrets/default.nix @@ -5,4 +5,5 @@ let in { "secrets/mlabs-cachix.age".publicKeys = [keys.agenix]; "secrets/autistici-password.age".publicKeys = [keys.agenix]; + "secrets/magit-forge-github-token.age".publicKeys = [keys.agenix]; } diff --git a/secrets/magit-forge-github-token.age b/secrets/magit-forge-github-token.age new file mode 100644 index 0000000..8ae2842 --- /dev/null +++ b/secrets/magit-forge-github-token.age @@ -0,0 +1,18 @@ +age-encryption.org/v1 +-> ssh-rsa QHr3/A +minytBGD5mhGlZVBUiHlTCKgR/IQBa5CLqr49w39AM8fjjJtj19UryLyoA1Jouef +GKRU+uR16Lj9MjdqJhcGi7Ox7/L+Si/eh5M5y08G0M8bod6VTyezbjWjbKTeoY68 +72Iz20s254jP75jhlyekL/rTQJR9aeQiDsVXBr02wu8ICC+eESfTiq8Srwwaq3Gr +H/rfHO2/vqrA+NYSI9I+1fCYp+8YLSIAMmDI4jjrC/d3RQhDkiqhn2uvslV5UiqH +yBcfIEz7CSNdJp5KfF/Qw2BgepkMibYj+iKZ9zfYZJQyQy8FCEXfx+BwwjdEPadk +0lOmatm1UmR8BAl0LCof7VxwsEbTeQHuz/FX/kfadlxNSUYF0bkVBNWHsLG1YP6Y +JBzFiBA5Wy8qEUHIeKmVP70moVohURiTliV8mN1dL490ns+kgpBPjQm+ThJGXyCE +ibx6j8AmGxMXoykBIFYxi3HvSJm5CKhUahBCHLlTdcUoGqDMz6ZS0Ys6ojW6iMEu +VfI1ZeHScnFKmR7Y237i5ZRYl4wUD7tjBSHl+7T1UsHUyg6Vymop6tiR+TYp0Jwp +j+1V4irQ5PVbULWW5IYEDzyeggiUUarWXJQiIhZvR+w5IQGK0OpigWqlzZz/OJ9N +8VyiKhr1/Q7Lbxvt3aF/gudZG9HeDVAnXTLSxF/HfWs +-> k04\pIXA-grease !~)DrR 8gGWs" % +bWx1d5LHHOqqMjp9oLbsWfuSmojeftp2Cm9gfvf78lbLFfamqVRJDZiqwCOBF8Zx +haDVCJPzlTbXJ7dJ3A +--- Oj+guFcy4YP1C3mhTRK7WIogGKH1PH06Ppc+MqT6dV0 +cp ̓lIFCamT 5lɓ! `Ykg4p5fpR0|] \ No newline at end of file diff --git a/utils/default.nix b/utils/default.nix index 30638bc..c3f40d9 100644 --- a/utils/default.nix +++ b/utils/default.nix @@ -6,6 +6,7 @@ nixosHardware, nixpkgsUnstable, preCommitHooks, + rock5b, self, ... }: let @@ -75,6 +76,11 @@ name = "beebox"; system = supportedSystems.x86_64-linux; }; + rock5b = mkConfiguration { + name = "rock5b"; + system = supportedSystems.aarch64-linux; + modules = [rock5b.nixosModules.kernel rock5b.nixosModules.fan-control]; + }; }; mkVmApp = system: configuration: let