diff --git a/.envrc b/.envrc deleted file mode 100644 index 37d3ae2..0000000 --- a/.envrc +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -source "$( - nix eval \ - --no-update-lock-file \ - --no-write-lock-file \ - --no-warn-dirty \ - --accept-flake-config \ - .#__std.direnv_lib 2>/dev/null -)" -use std comb //_QUEEN/devshells:default diff --git a/README.md b/README.md index 8ebcd9b..db066f7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- +

The Hive

The secretly open NixOS-Society

diff --git a/logo.svg b/artwork/logo.svg similarity index 100% rename from logo.svg rename to artwork/logo.svg diff --git a/comb/_QUEEN/colmenaConfigurations.nix b/comb/_QUEEN/colmenaConfigurations.nix deleted file mode 100644 index 72e4116..0000000 --- a/comb/_QUEEN/colmenaConfigurations.nix +++ /dev/null @@ -1,16 +0,0 @@ -let - inherit (cell) nixosSuites; -in { - larva = { - bee.system = "x86_64-linux"; - bee.pkgs = inputs.nixos.legacyPackages; - deployment = { - targetHost = "fe80::47"; - targetPort = 22; - targetUser = "root"; - allowLocalDeployment = false; - buildOnTarget = false; - }; - imports = [nixosSuites.larva]; - }; -} diff --git a/comb/_QUEEN/devshells.nix b/comb/_QUEEN/devshells.nix deleted file mode 100644 index 070fdfd..0000000 --- a/comb/_QUEEN/devshells.nix +++ /dev/null @@ -1,42 +0,0 @@ -let - l = nixpkgs.lib // builtins; - - inherit (inputs) nixpkgs std; - inherit (std.lib) dev; - - withCategory = category: attrset: attrset // {inherit category;}; -in - l.mapAttrs (_: dev.mkShell) { - default = {...}: { - name = "Apis Mellifera"; - nixago = with std.presets.nixago; [ - treefmt - lefthook - editorconfig - (conform {configData = {inherit (inputs) cells;};}) - ]; - imports = []; - commands = [ - (withCategory "hexagon" {package = inputs.nixpkgs.writedisk;}) - (withCategory "hexagon" {package = inputs.disko.packages.disko;}) - (withCategory "hexagon" {package = inputs.home.packages.home-manager;}) - (withCategory "hexagon" {package = inputs.colmena.packages.colmena;}) - (withCategory "hexagon" {package = inputs.nixos-generators.packages.nixos-generate;}) - (withCategory "hexagon" { - name = "build-larva"; - help = "the hive x86_64-linux iso-bootstrapper"; - command = '' - echo "Boostrap image is building ..." - if path=$(nix build $PRJ_ROOT#nixosConfigurations._QUEEN-o-larva.config.system.build.isoImage --print-out-paths); then - echo "Boostrap image build finished." - echo "-------" - echo "You can now burn it to a USB with the following command:" - echo -e "writedisk ./result/iso/$(echo $path | cut --delimiter '-' --output-delimiter '-' -f 2-)" - else - echo "Boostrap image build failed." - fi - ''; - }) - ]; - }; - } diff --git a/comb/_QUEEN/nixosConfigurations.nix b/comb/_QUEEN/nixosConfigurations.nix deleted file mode 100644 index a0e0096..0000000 --- a/comb/_QUEEN/nixosConfigurations.nix +++ /dev/null @@ -1,9 +0,0 @@ -let - inherit (cell) nixosSuites; -in { - larva = { - bee.system = "x86_64-linux"; - bee.pkgs = inputs.nixos.legacyPackages; - imports = [nixosSuites.larva]; - }; -} diff --git a/comb/_QUEEN/nixosProfiles.nix b/comb/_QUEEN/nixosProfiles.nix deleted file mode 100644 index 7995683..0000000 --- a/comb/_QUEEN/nixosProfiles.nix +++ /dev/null @@ -1,89 +0,0 @@ -let - inherit (inputs) nixpkgs nixos-generators; - l = nixpkgs.lib // builtins; -in { - bootstrap = { - config, - options, - pkgs, - ... - }: { - imports = [ - nixos-generators.nixosModules.install-iso - ]; - - nix = { - # only part of ./modules/profiles/channels.nix since 22.11 - registry.nixpkgs.flake.outPath = builtins.path { - name = "source"; - path = pkgs.path; - }; - package = nixpkgs.nix; - extraOptions = '' - experimental-features = nix-command flakes recursive-nix - ''; - }; - - networking.domain = "local"; - - # Provide networkmanager for easy wireless configuration. - networking.networkmanager.enable = true; - networking.wireless.enable = l.mkForce false; - services.getty.helpLine = - '' - The "nixos" and "root" accounts have empty passwords. - - An ssh daemon is running. You then must set a password - for either "root" or "nixos" with `passwd` or add an ssh key - to /home/nixos/.ssh/authorized_keys be able to login. - - If you need a wireless connection, type - ``sudo systemctl start NetworkManager` and configure a - network using `sudo ifwifi scan` & `sudo ifwifi connect`. - See the NixOS manual for details. - '' - + l.optionalString config.services.xserver.enable '' - - Type `sudo systemctl start display-manager' to - start the graphical user interface. - ''; - environment.systemPackages = [ - (pkgs.callPackage ./nixosProfiles/ifwifi { - inherit (pkgs.darwin.apple_sdk.frameworks) Security; - }) - ]; - - isoImage = { - isoBaseName = "bootstrap-hive-from-queen"; - contents = [ - { - source = inputs.self; - target = "/hive/"; - } - ]; - }; - - systemd.network = { - # https://www.freedesktop.org/software/systemd/man/systemd.network.html - networks."boostrap-link-local" = { - matchConfig = { - Name = "en* wl* ww*"; - }; - networkConfig = { - Description = "Link-local host bootstrap network"; - MulticastDNS = true; - LinkLocalAddressing = "ipv6"; - DHCP = "yes"; - }; - address = [ - # fall back well-known link-local for situations where MulticastDNS is not available - "fe80::47" # 47: n=14 i=9 x=24; n+i+x - ]; - extraConfig = '' - # Unique, yet stable. Based off the MAC address. - IPv6LinkLocalAddressGenerationMode = "eui64" - ''; - }; - }; - }; -} diff --git a/comb/_QUEEN/nixosProfiles/ifwifi/default.nix b/comb/_QUEEN/nixosProfiles/ifwifi/default.nix deleted file mode 100644 index 48eab7b..0000000 --- a/comb/_QUEEN/nixosProfiles/ifwifi/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - rustPlatform, - darwin, - iw, - networkmanager, - Security, - makeWrapper, -}: -rustPlatform.buildRustPackage rec { - pname = "ifwifi"; - version = "1.0.3"; - - src = fetchFromGitHub { - owner = "araujobsd"; - repo = "ifwifi"; - rev = "${version}"; - sha256 = "sha256-RYxBlqG8yV7ZhqTkWbzrGI/ZJRF55JN+kUlqFj/Bs7s="; - }; - - cargoSha256 = "sha256-ys4tXP46pTXj9LSVISBRX+9xj7ijJddS86YzHHzK+jQ="; - - nativeBuildInputs = [makeWrapper]; - buildInputs = lib.optional stdenv.isDarwin Security; - - postInstall = '' - wrapProgram "$out/bin/ifwifi" \ - --prefix PATH : "${ - lib.makeBinPath ([ - # `ifwifi` runtime dep - networkmanager - ] - # `wifiscanner` crate's runtime deps - ++ (lib.optional stdenv.isLinux iw)) - # ++ (lib.optional stdenv.isDarwin airport) # airport isn't packaged - }" - ''; - - doCheck = true; - - meta = with lib; { - description = "A simple wrapper over nmcli using wifiscanner made in rust"; - longDescription = '' - In the author's words: - - I felt bothered because I never remember the long and tedious command - line to setup my wifi interface. So, I wanted to develop something - using rust to simplify the usage of nmcli, and I met the wifiscanner - project that gave me almost everything I wanted to create this tool. - ''; - homepage = "https://github.com/araujobsd/ifwifi"; - license = with licenses; [bsd2]; - maintainers = with maintainers; [blaggacao]; - platforms = platforms.linux; - }; -} diff --git a/comb/_QUEEN/nixosSuites.nix b/comb/_QUEEN/nixosSuites.nix deleted file mode 100644 index e91dc4f..0000000 --- a/comb/_QUEEN/nixosSuites.nix +++ /dev/null @@ -1,9 +0,0 @@ -let - inherit (cell) nixosProfiles; -in { - larva = { - imports = [ - nixosProfiles.bootstrap - ]; - }; -} diff --git a/comb/blaggacao/colmenaConfigurations.nix b/comb/blaggacao/colmenaConfigurations.nix deleted file mode 100644 index f13c20e..0000000 --- a/comb/blaggacao/colmenaConfigurations.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - ws = { - bee.system = "x86_64-linux"; - bee.pkgs = inputs.nixos.legacyPackages; - }; -} diff --git a/comb/blaggacao/homeConfigurations.nix b/comb/blaggacao/homeConfigurations.nix deleted file mode 100644 index 8e801f0..0000000 --- a/comb/blaggacao/homeConfigurations.nix +++ /dev/null @@ -1,54 +0,0 @@ -let - inherit (cell) homeSuites; - inherit (inputs) nixgl nixos; # home - - name = "David Arnold"; - # email = "dgx.arnold@gmail.com"; - # gitSigningKey = "AB15A6AF1101390D"; - email = "david.arnold@iohk.io"; - gitSigningKey = "0318D822BAC965CC"; - - programs = { - git = { - userName = name; - userEmail = email; - signing = { - key = gitSigningKey; - signByDefault = true; - }; - }; - }; - bee = { - system = "x86_64-linux"; - inherit (inputs) home; - pkgs = inputs.nixos.legacyPackages; - }; - home = rec { - homeDirectory = "/home/${username}"; - stateVersion = "22.05"; - username = "blaggacao"; - }; - manual = { - manpages.enable = false; # causes error - html.enable = false; # saves space - json.enable = false; # don't know what to do with this - }; -in { - workstation = { - inherit programs bee home manual; - targets.genericLinux.enable = true; - imports = with homeSuites; - [] - ++ gui - ++ shell - ++ system; - }; - server = { - inherit programs bee home manual; - targets.genericLinux.enable = true; - imports = with homeSuites; - [] - ++ shell - ++ system; - }; -} diff --git a/comb/blaggacao/homeModules/default.nix b/comb/blaggacao/homeModules/default.nix deleted file mode 100644 index 2cb593f..0000000 --- a/comb/blaggacao/homeModules/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - alacritty = import ./programs/alacritty; -} diff --git a/comb/blaggacao/homeModules/programs/alacritty/default.nix b/comb/blaggacao/homeModules/programs/alacritty/default.nix deleted file mode 100644 index db802bb..0000000 --- a/comb/blaggacao/homeModules/programs/alacritty/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; let - cfg = config.programs.alacritty; - CSIuKeyBindings = (builtins.fromTOML (builtins.readFile ./key-bindings.toml)).key_bindings; -in { - options = { - programs.alacritty = { - CSIuSupport = mkEnableOption "Enable CSIu support"; - }; - }; - - config = mkMerge [ - (mkIf cfg.enable { - programs.alacritty.settings.key_bindings = - mkIf cfg.CSIuSupport CSIuKeyBindings; - }) - ]; -} diff --git a/comb/blaggacao/homeModules/programs/alacritty/key-bindings.toml b/comb/blaggacao/homeModules/programs/alacritty/key-bindings.toml deleted file mode 100644 index dec5013..0000000 --- a/comb/blaggacao/homeModules/programs/alacritty/key-bindings.toml +++ /dev/null @@ -1,964 +0,0 @@ -# Avoid to override default key-bindings -# -# Control + B ⇒ SearchBackward -# Control + C ⇒ Copy -# Control + F ⇒ SearchForward -# Control + V ⇒ Paste -# Control + 0 ⇒ ResetFontSize -# -# https://github.com/alacritty/alacritty/blob/master/alacritty.yml -[[key_bindings]] -key = "H" -mods = "Control" -chars = "\u001b[104;5u" - -[[key_bindings]] -key = "H" -mods = "Control|Alt" -chars = "\u001b[104;7u" - -[[key_bindings]] -key = "I" -mods = "Control" -chars = "\u001b[105;5u" - -[[key_bindings]] -key = "I" -mods = "Control|Alt" -chars = "\u001b[105;7u" - -[[key_bindings]] -key = "J" -mods = "Control" -chars = "\u001b[106;5u" - -[[key_bindings]] -key = "J" -mods = "Control|Alt" -chars = "\u001b[106;7u" - -[[key_bindings]] -key = "M" -mods = "Control" -chars = "\u001b[109;5u" - -[[key_bindings]] -key = "M" -mods = "Control|Alt" -chars = "\u001b[109;7u" - -[[key_bindings]] -key = "O" -mods = "Shift|Alt" -chars = "\u001b[79;3u" - -[[key_bindings]] -key = "Return" -mods = "Control" -chars = "\u001b[13;5u" - -[[key_bindings]] -key = "Return" -mods = "Shift" -chars = "\u001b[13;2u" - -[[key_bindings]] -key = "Return" -mods = "Shift|Control" -chars = "\u001b[13;6u" - -[[key_bindings]] -key = "Return" -mods = "Shift|Alt" -chars = "\u001b[13;4u" - -[[key_bindings]] -key = "Return" -mods = "Alt|Control" -chars = "\u001b[13;7u" - -[[key_bindings]] -key = "Return" -mods = "Shift|Alt|Control" -chars = "\u001b[13;8u" - -# [[key_bindings]] -# key = "Slash" -# mods = "Control" -# chars = "\u001b[47;2u" -[[key_bindings]] -key = "Space" -mods = "Shift" -chars = "\u001b[32;2u" - -# [[key_bindings]] -# key = "Space" -# mods = "Shift|Control" -# chars = "\u001b[32;6u" -[[key_bindings]] -key = "Space" -mods = "Shift|Alt" -chars = "\u001b[32;4u" - -[[key_bindings]] -key = "Space" -mods = "Shift|Alt|Control" -chars = "\u001b[32;8u" - -[[key_bindings]] -key = "Back" -mods = "Shift" -chars = "\u001b[127;2u" - -[[key_bindings]] -key = "Back" -mods = "Control" -chars = "\u001b[127;5u" - -[[key_bindings]] -key = "Back" -mods = "Shift|Control" -chars = "\u001b[127;6u" - -[[key_bindings]] -key = "Back" -mods = "Shift|Alt" -chars = "\u001b[127;4u" - -[[key_bindings]] -key = "Back" -mods = "Alt|Control" -chars = "\u001b[127;7u" - -[[key_bindings]] -key = "Back" -mods = "Shift|Alt|Control" -chars = "\u001b[127;8u" - -[[key_bindings]] -key = "Tab" -mods = "Control" -chars = "\u001b[9;5u" - -[[key_bindings]] -key = "Tab" -mods = "Alt|Control" -chars = "\u001b[9;7u" - -[[key_bindings]] -key = "Tab" -mods = "Shift|Alt" -chars = "\u001b[9;4u" - -[[key_bindings]] -key = "Tab" -mods = "Shift|Control" -chars = "\u001b[9;6u" - -[[key_bindings]] -key = "Tab" -mods = "Shift|Alt|Control" -chars = "\u001b[9;8u" - -[[key_bindings]] -key = "Escape" -mods = "Alt" -chars = "\u001b[27;3u" - -[[key_bindings]] -key = "Escape" -mods = "Control" -chars = "\u001b[27;5u" - -[[key_bindings]] -key = "Escape" -mods = "Shift" -chars = "\u001b[27;2u" - -[[key_bindings]] -key = "Escape" -mods = "Shift|Control" -chars = "\u001b[27;6u" - -[[key_bindings]] -key = "Escape" -mods = "Shift|Alt" -chars = "\u001b[27;4u" - -[[key_bindings]] -key = "Escape" -mods = "Alt|Control" -chars = "\u001b[27;7u" - -[[key_bindings]] -key = "Escape" -mods = "Shift|Alt|Control" -chars = "\u001b[27;8u" - -[[key_bindings]] # 1 -key = 2 -mods = "Control" -chars = "\u001b[49;5u" - -[[key_bindings]] # 1 -key = 2 -mods = "Alt|Control" -chars = "\u001b[49;7u" - -[[key_bindings]] # ! -key = 2 -mods = "Shift|Control" -chars = "\u001b[33;5u" - -[[key_bindings]] # ! -key = 2 -mods = "Shift|Alt|Control" -chars = "\u001b[33;7u" - -[[key_bindings]] # 2 -key = 3 -mods = "Control" -chars = "\u001b[50;5u" - -[[key_bindings]] # 2 -key = 3 -mods = "Alt|Control" -chars = "\u001b[50;7u" - -[[key_bindings]] # @ -key = 3 -mods = "Shift|Control" -chars = "\u001b[64;5u" - -[[key_bindings]] # @ -key = 3 -mods = "Shift|Alt|Control" -chars = "\u001b[64;7u" - -[[key_bindings]] # 3 -key = 4 -mods = "Control" -chars = "\u001b[51;5u" - -[[key_bindings]] # 3 -key = 4 -mods = "Alt|Control" -chars = "\u001b[51;7u" - -[[key_bindings]] # # -key = 4 -mods = "Shift|Control" -chars = "\u001b[35;5u" - -[[key_bindings]] # # -key = 4 -mods = "Shift|Alt|Control" -chars = "\u001b[35;7u" - -[[key_bindings]] # 4 -key = 5 -mods = "Control" -chars = "\u001b[52;5u" - -[[key_bindings]] # 4 -key = 5 -mods = "Alt|Control" -chars = "\u001b[52;7u" - -[[key_bindings]] # $ -key = 5 -mods = "Shift|Control" -chars = "\u001b[36;5u" - -[[key_bindings]] # $ -key = 5 -mods = "Shift|Alt|Control" -chars = "\u001b[36;7u" - -[[key_bindings]] # 5 -key = 6 -mods = "Control" -chars = "\u001b[53;5u" - -[[key_bindings]] # 5 -key = 6 -mods = "Alt|Control" -chars = "\u001b[53;7u" - -[[key_bindings]] # % -key = 6 -mods = "Shift|Control" -chars = "\u001b[37;5u" - -[[key_bindings]] # % -key = 6 -mods = "Shift|Alt|Control" -chars = "\u001b[37;7u" - -[[key_bindings]] # 6 -key = 7 -mods = "Control" -chars = "\u001b[54;5u" - -[[key_bindings]] # 6 -key = 7 -mods = "Alt|Control" -chars = "\u001b[54;7u" - -[[key_bindings]] # ^ -key = 7 -mods = "Shift|Control" -chars = "\u001b[94;5u" - -[[key_bindings]] # ^ -key = 7 -mods = "Shift|Alt|Control" -chars = "\u001b[94;7u" - -[[key_bindings]] # 7 -key = 8 -mods = "Control" -chars = "\u001b[55;5u" - -[[key_bindings]] # 7 -key = 8 -mods = "Alt|Control" -chars = "\u001b[55;7u" - -[[key_bindings]] # & -key = 8 -mods = "Shift|Control" -chars = "\u001b[38;5u" - -[[key_bindings]] # & -key = 8 -mods = "Shift|Alt|Control" -chars = "\u001b[38;7u" - -[[key_bindings]] # 8 -key = 9 -mods = "Control" -chars = "\u001b[56;5u" - -[[key_bindings]] # 8 -key = 9 -mods = "Alt|Control" -chars = "\u001b[56;7u" - -[[key_bindings]] # * -key = 9 -mods = "Shift|Control" -chars = "\u001b[42;5u" - -[[key_bindings]] # * -key = 9 -mods = "Shift|Alt|Control" -chars = "\u001b[42;7u" - -[[key_bindings]] # 9 -key = 10 -mods = "Control" -chars = "\u001b[57;5u" - -[[key_bindings]] # 9 -key = 10 -mods = "Alt|Control" -chars = "\u001b[57;7u" - -[[key_bindings]] # ( -key = 10 -mods = "Shift|Control" -chars = "\u001b[40;5u" - -[[key_bindings]] # ( -key = 10 -mods = "Shift|Alt|Control" -chars = "\u001b[40;7u" - -[[key_bindings]] # 0 -key = 11 -mods = "Control" -chars = "\u001b[48;5u" - -[[key_bindings]] # 0 -key = 11 -mods = "Alt|Control" -chars = "\u001b[48;7u" - -[[key_bindings]] # ) -key = 11 -mods = "Shift|Control" -chars = "\u001b[41;5u" - -[[key_bindings]] # ) -key = 11 -mods = "Shift|Alt|Control" -chars = "\u001b[41;7u" - -[[key_bindings]] # - -key = 12 -mods = "Control" -chars = "\u001b[45;5u" - -[[key_bindings]] # - -key = 12 -mods = "Alt|Control" -chars = "\u001b[45;7u" - -[[key_bindings]] # _ -key = 12 -mods = "Shift|Control" -chars = "\u001b[95;5u" - -[[key_bindings]] # _ -key = 12 -mods = "Shift|Alt|Control" -chars = "\u001b[95;7u" - -[[key_bindings]] # = -key = 13 -mods = "Control" -chars = "\u001b[61;5u" - -[[key_bindings]] # = -key = 13 -mods = "Alt|Control" -chars = "\u001b[61;7u" - -[[key_bindings]] # + -key = 13 -mods = "Shift|Control" -chars = "\u001b[43;5u" - -[[key_bindings]] # + -key = 13 -mods = "Shift|Alt|Control" -chars = "\u001b[43;7u" - -[[key_bindings]] # [ -key = 26 -mods = "Control" -chars = "\u001b[91;5u" - -[[key_bindings]] # [ -key = 26 -mods = "Alt|Control" -chars = "\u001b[91;7u" - -[[key_bindings]] # [ -key = 26 -mods = "Alt" -chars = "\u001b[91;3u" - -[[key_bindings]] # { -key = 26 -mods = "Shift|Control" -chars = "\u001b[123;5u" - -[[key_bindings]] # { -key = 26 -mods = "Shift|Alt|Control" -chars = "\u001b[123;7u" - -[[key_bindings]] # ] -key = 27 -mods = "Control" -chars = "\u001b[93;5u" - -[[key_bindings]] # ] -key = 27 -mods = "Alt|Control" -chars = "\u001b[93;7u" - -[[key_bindings]] # } -key = 27 -mods = "Shift|Control" -chars = "\u001b[125;5u" - -[[key_bindings]] # } -key = 27 -mods = "Shift|Alt|Control" -chars = "\u001b[125;7u" - -[[key_bindings]] # ' -key = 40 -mods = "Control" -chars = "\u001b[39;5u" - -[[key_bindings]] # ' -key = 40 -mods = "Alt|Control" -chars = "\u001b[39;7u" - -[[key_bindings]] # " -key = 40 -mods = "Shift|Control" -chars = "\u001b[34;5u" - -[[key_bindings]] # " -key = 40 -mods = "Shift|Alt|Control" -chars = "\u001b[34;7u" - -[[key_bindings]] # ` -key = 41 -mods = "Control" -chars = "\u001b[96;5u" - -[[key_bindings]] # ` -key = 41 -mods = "Alt|Control" -chars = "\u001b[96;7u" - -[[key_bindings]] # ~ -key = 41 -mods = "Shift|Control" -chars = "\u001b[126;5u" - -[[key_bindings]] # ~ -key = 41 -mods = "Shift|Alt|Control" -chars = "\u001b[126;7u" - -[[key_bindings]] # ; -key = 39 -mods = "Control" -chars = "\u001b[59;5u" - -[[key_bindings]] # ; -key = 39 -mods = "Alt|Control" -chars = "\u001b[59;7u" - -[[key_bindings]] # : -key = 39 -mods = "Shift|Control" -chars = "\u001b[58;5u" - -[[key_bindings]] # : -key = 39 -mods = "Shift|Alt|Control" -chars = "\u001b[58;7u" - -[[key_bindings]] # / -key = 53 -mods = "Control" -chars = "\u001b[47;5u" - -[[key_bindings]] # / -key = 53 -mods = "Alt|Control" -chars = "\u001b[47;7u" - -[[key_bindings]] # ? -key = 53 -mods = "Shift|Control" -chars = "\u001b[63;5u" - -[[key_bindings]] # ? -key = 53 -mods = "Shift|Alt|Control" -chars = "\u001b[63;7u" - -[[key_bindings]] # , -key = 51 -mods = "Control" -chars = "\u001b[44;5u" - -[[key_bindings]] # , -key = 51 -mods = "Alt|Control" -chars = "\u001b[44;7u" - -[[key_bindings]] # < -key = 51 -mods = "Shift|Control" -chars = "\u001b[60;5u" - -[[key_bindings]] # < -key = 51 -mods = "Shift|Alt|Control" -chars = "\u001b[60;7u" - -[[key_bindings]] # . -key = 52 -mods = "Control" -chars = "\u001b[46;5u" - -[[key_bindings]] # . -key = 52 -mods = "Alt|Control" -chars = "\u001b[46;7u" - -[[key_bindings]] # > -key = 52 -mods = "Shift|Control" -chars = "\u001b[62;5u" - -[[key_bindings]] # > -key = 52 -mods = "Shift|Alt|Control" -chars = "\u001b[62;7u" - -[[key_bindings]] -key = "A" -mods = "Control|Shift" -chars = "\u001b[65;5u" - -[[key_bindings]] -key = "A" -mods = "Control|Shift|Alt" -chars = "\u001b[65;7u" - -# Control + B ⇒ SearchBackward -# [[key_bindings]] -# key = "B" -# mods = "Control|Shift" -# chars = "\u001b[66;5u" -[[key_bindings]] -key = "B" -mods = "Control|Shift|Alt" -chars = "\u001b[66;7u" - -# Control + C ⇒ Copy -# [[key_bindings]] -# key = "C" -# mods = "Control|Shift" -# chars = "\u001b[67;5u" -[[key_bindings]] -key = "C" -mods = "Control|Shift|Alt" -chars = "\u001b[67;7u" - -[[key_bindings]] -key = "D" -mods = "Control|Shift" -chars = "\u001b[68;5u" - -[[key_bindings]] -key = "D" -mods = "Control|Shift|Alt" -chars = "\u001b[68;7u" - -[[key_bindings]] -key = "E" -mods = "Control|Shift" -chars = "\u001b[69;5u" - -[[key_bindings]] -key = "E" -mods = "Control|Shift|Alt" -chars = "\u001b[69;7u" - -# Control + F ⇒ SearchForward -# [[key_bindings]] -# key = "F" -# mods = "Control|Shift" -# chars = "\u001b[70;5u" -[[key_bindings]] -key = "F" -mods = "Control|Shift|Alt" -chars = "\u001b[70;7u" - -[[key_bindings]] -key = "G" -mods = "Control|Shift" -chars = "\u001b[71;5u" - -[[key_bindings]] -key = "G" -mods = "Control|Shift|Alt" -chars = "\u001b[71;7u" - -[[key_bindings]] -key = "H" -mods = "Control|Shift" -chars = "\u001b[72;5u" - -[[key_bindings]] -key = "H" -mods = "Control|Shift|Alt" -chars = "\u001b[72;7u" - -[[key_bindings]] -key = "I" -mods = "Control|Shift" -chars = "\u001b[73;5u" - -[[key_bindings]] -key = "I" -mods = "Control|Shift|Alt" -chars = "\u001b[73;7u" - -[[key_bindings]] -key = "J" -mods = "Control|Shift" -chars = "\u001b[74;5u" - -[[key_bindings]] -key = "J" -mods = "Control|Shift|Alt" -chars = "\u001b[74;7u" - -[[key_bindings]] -key = "K" -mods = "Control|Shift" -chars = "\u001b[75;5u" - -[[key_bindings]] -key = "K" -mods = "Control|Shift|Alt" -chars = "\u001b[75;7u" - -[[key_bindings]] -key = "L" -mods = "Control|Shift" -chars = "\u001b[76;5u" - -[[key_bindings]] -key = "L" -mods = "Control|Shift|Alt" -chars = "\u001b[76;7u" - -[[key_bindings]] -key = "M" -mods = "Control|Shift" -chars = "\u001b[77;5u" - -[[key_bindings]] -key = "M" -mods = "Control|Shift|Alt" -chars = "\u001b[77;7u" - -[[key_bindings]] -key = "N" -mods = "Control|Shift" -chars = "\u001b[78;5u" - -[[key_bindings]] -key = "N" -mods = "Control|Shift|Alt" -chars = "\u001b[78;7u" - -[[key_bindings]] -key = "O" -mods = "Control|Shift" -chars = "\u001b[79;5u" - -[[key_bindings]] -key = "O" -mods = "Control|Shift|Alt" -chars = "\u001b[79;7u" - -[[key_bindings]] -key = "P" -mods = "Control|Shift" -chars = "\u001b[80;5u" - -[[key_bindings]] -key = "P" -mods = "Control|Shift|Alt" -chars = "\u001b[80;7u" - -[[key_bindings]] -key = "Q" -mods = "Control|Shift" -chars = "\u001b[81;5u" - -[[key_bindings]] -key = "Q" -mods = "Control|Shift|Alt" -chars = "\u001b[81;7u" - -[[key_bindings]] -key = "R" -mods = "Control|Shift" -chars = "\u001b[82;5u" - -[[key_bindings]] -key = "R" -mods = "Control|Shift|Alt" -chars = "\u001b[82;7u" - -[[key_bindings]] -key = "S" -mods = "Control|Shift" -chars = "\u001b[83;5u" - -[[key_bindings]] -key = "S" -mods = "Control|Shift|Alt" -chars = "\u001b[83;7u" - -[[key_bindings]] -key = "T" -mods = "Control|Shift" -chars = "\u001b[84;5u" - -[[key_bindings]] -key = "T" -mods = "Control|Shift|Alt" -chars = "\u001b[84;7u" - -[[key_bindings]] -key = "U" -mods = "Control|Shift" -chars = "\u001b[85;5u" - -[[key_bindings]] -key = "U" -mods = "Control|Shift|Alt" -chars = "\u001b[85;7u" - -# Control + V ⇒ Paste -# [[key_bindings]] -# key = "V" -# mods = "Control|Shift" -# chars = "\u001b[86;5u" -[[key_bindings]] -key = "V" -mods = "Control|Shift|Alt" -chars = "\u001b[86;7u" - -[[key_bindings]] -key = "W" -mods = "Control|Shift" -chars = "\u001b[87;5u" - -[[key_bindings]] -key = "W" -mods = "Control|Shift|Alt" -chars = "\u001b[87;7u" - -[[key_bindings]] -key = "X" -mods = "Control|Shift" -chars = "\u001b[88;5u" - -[[key_bindings]] -key = "X" -mods = "Control|Shift|Alt" -chars = "\u001b[88;7u" - -[[key_bindings]] -key = "Y" -mods = "Control|Shift" -chars = "\u001b[89;5u" - -[[key_bindings]] -key = "Y" -mods = "Control|Shift|Alt" -chars = "\u001b[89;7u" - -[[key_bindings]] -key = "Z" -mods = "Control|Shift" -chars = "\u001b[90;5u" - -[[key_bindings]] -key = "Z" -mods = "Control|Shift|Alt" -chars = "\u001b[90;7u" - -# ################################ -# Non-Captured NumKey Combinations -# ################################ -# Control + 0 ⇒ ResetFontSize -# [[key_bindings]] -# key = "Key0" -# mods = "Control" -# chars = "\u001b[48;5u" -[[key_bindings]] -key = "Key1" -mods = "Control" -chars = "\u001b[49;5u" - -[[key_bindings]] -key = "Key2" -mods = "Control" -chars = "\u001b[50;5u" - -[[key_bindings]] -key = "Key3" -mods = "Control" -chars = "\u001b[51;5u" - -[[key_bindings]] -key = "Key4" -mods = "Control" -chars = "\u001b[52;5u" - -[[key_bindings]] -key = "Key5" -mods = "Control" -chars = "\u001b[53;5u" - -[[key_bindings]] -key = "Key6" -mods = "Control" -chars = "\u001b[54;5u" - -[[key_bindings]] -key = "Key7" -mods = "Control" -chars = "\u001b[55;5u" - -[[key_bindings]] -key = "Key8" -mods = "Control" -chars = "\u001b[56;5u" - -[[key_bindings]] -key = "Key9" -mods = "Control" -chars = "\u001b[57;5u" - -[[key_bindings]] -key = "Key0" -mods = "Control|Shift" -chars = "\u001b[48;6u" - -[[key_bindings]] -key = "Key1" -mods = "Control|Shift" -chars = "\u001b[49;6u" - -[[key_bindings]] -key = "Key2" -mods = "Control|Shift" -chars = "\u001b[50;6u" - -[[key_bindings]] -key = "Key3" -mods = "Control|Shift" -chars = "\u001b[51;6u" - -[[key_bindings]] -key = "Key4" -mods = "Control|Shift" -chars = "\u001b[52;6u" - -[[key_bindings]] -key = "Key5" -mods = "Control|Shift" -chars = "\u001b[53;6u" - -[[key_bindings]] -key = "Key6" -mods = "Control|Shift" -chars = "\u001b[54;6u" - -[[key_bindings]] -key = "Key7" -mods = "Control|Shift" -chars = "\u001b[55;6u" - -[[key_bindings]] -key = "Key8" -mods = "Control|Shift" -chars = "\u001b[56;6u" - -[[key_bindings]] -key = "Key9" -mods = "Control|Shift" -chars = "\u001b[57;6u" diff --git a/comb/blaggacao/homeProfiles.nix b/comb/blaggacao/homeProfiles.nix deleted file mode 100644 index 531e85f..0000000 --- a/comb/blaggacao/homeProfiles.nix +++ /dev/null @@ -1,17 +0,0 @@ -let - inherit (inputs) nixpkgs nixgl; -in { - shellPrograms.programs = import ./homeProfiles/shellPrograms.nix; - guiPrograms.programs = import ./homeProfiles/guiPrograms.nix; - shellPackages.home.packages = import ./homeProfiles/shellPackages.nix nixpkgs; - guiPackages.home.packages = import ./homeProfiles/guiPackages.nix nixpkgs; - systemProfile = { - home.packages = [ - nixpkgs.nix - nixgl.packages.nixGLIntel - ]; - nix = { - package = nixpkgs.nix; - }; - }; -} diff --git a/comb/blaggacao/homeProfiles/guiPackages.nix b/comb/blaggacao/homeProfiles/guiPackages.nix deleted file mode 100644 index 81eec0d..0000000 --- a/comb/blaggacao/homeProfiles/guiPackages.nix +++ /dev/null @@ -1,4 +0,0 @@ -nixpkgs: -with nixpkgs; [ - element-desktop -] diff --git a/comb/blaggacao/homeProfiles/guiPrograms.nix b/comb/blaggacao/homeProfiles/guiPrograms.nix deleted file mode 100644 index cfa4e7c..0000000 --- a/comb/blaggacao/homeProfiles/guiPrograms.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - browserpass.enable = true; - chromium.enable = true; -} diff --git a/comb/blaggacao/homeProfiles/shellPackages.nix b/comb/blaggacao/homeProfiles/shellPackages.nix deleted file mode 100644 index 7acf06a..0000000 --- a/comb/blaggacao/homeProfiles/shellPackages.nix +++ /dev/null @@ -1,28 +0,0 @@ -nixpkgs: -with nixpkgs; [ - choose # between cut & awk - beautiful - curlie # modern curl - dogdns # modern dig - duf # modern df - du-dust # modern du - exa # modern ls (not on LSD) - fx # jq, but don't admit you somtimes like to use a mouse - fd # modern find - gping # modern ping - hyperfine # benchmark shell commands like a boss - ijq # interactive jq wrapper, requires jq - magic-wormhole # secure file sharing over cli - procs # modern ps - sd # modern sed - thefuck # if you mistyped: fuck - tty-share # Secure terminal-session sharing - watchexec # Executes commands in response to file modifications - h # faster shell navigation of projects - jd-diff-patch # semantic json differ - arping - pijul # modern darcs-inspired vcs - eva # modern bc - manix # explore nixos/hm options - borgbackup # backup tool - git-filter-repo # rewrite git history like a pro (and fast) -] diff --git a/comb/blaggacao/homeProfiles/shellPrograms.nix b/comb/blaggacao/homeProfiles/shellPrograms.nix deleted file mode 100644 index 4a889b7..0000000 --- a/comb/blaggacao/homeProfiles/shellPrograms.nix +++ /dev/null @@ -1,161 +0,0 @@ -{ - gitui.enable = true; - bottom.enable = true; - navi.enable = true; - tealdeer.enable = true; - bat.enable = true; - broot.enable = true; - direnv.enable = true; - fzf.enable = true; - gpg.enable = true; - jq.enable = true; - mcfly.enable = true; - starship.enable = true; - zoxide.enable = true; - nnn.enable = true; - gh = { - enable = true; - settings.git_protocol = "ssh"; - }; - helix = { - enable = true; - }; - alacritty = { - enable = true; - CSIuSupport = true; - settings = { - env.TERM = "xterm-256color"; - window.decorations = "full"; - font.size = 9.0; - cursor.style = "Beam"; - - # snazzy theme - colors = { - # Default colors - primary = { - background = "0x282a36"; - foreground = "0xeff0eb"; - }; - - # Normal colors - normal = { - black = "0x282a36"; - red = "0xff5c57"; - green = "0x5af78e"; - yellow = "0xf3f99d"; - blue = "0x57c7ff"; - magenta = "0xff6ac1"; - cyan = "0x9aedfe"; - white = "0xf1f1f0"; - }; - - # Bright colors - bright = { - black = "0x686868"; - red = "0xff5c57"; - green = "0x5af78e"; - yellow = "0xf3f99d"; - blue = "0x57c7ff"; - magenta = "0xff6ac1"; - cyan = "0x9aedfe"; - white = "0xf1f1f0"; - }; - }; - }; - }; - git = { - enable = true; - delta.enable = true; - lfs.enable = true; - - delta.options = { - plus-style = "syntax #012800"; - minus-style = "syntax #340001"; - syntax-theme = "Monokai Extended"; - navigate = true; - }; - - extraConfig = { - core.autocrlf = "input"; - init.defaultBranch = "main"; - pull.rebase = true; - rebase.autosquash = true; - rerere.enabled = true; - }; - }; - zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - enableSyntaxHighlighting = true; - autocd = true; - history.share = true; - dotDir = ".config/zsh"; - shellGlobalAliases = { - "..." = "../.."; - "...." = "../../.."; - "....." = "../../../..."; - }; - shellAliases = { - d = "direnv"; - g = "git"; - jc = "journalctl"; - la = "exa -lah"; - l = "exa -lh"; - ls = "exa"; - md = "mkdir -p"; - n = "nix"; - rd = "rmdir"; - sc = "systemctl"; - "_" = "sudo "; - }; - initExtra = '' - function j() { - - if [ $# -eq 0 ]; then - _j_dir="$(fd --type d '\.git$' --hidden $HOME/src/ -d5 --prune | xargs dirname | fzf)" - else - _j_dir=$(command h --resolve $HOME/src/ "$@") - fi - - _j_ret=$? - - [ "$_j_dir" != "$PWD" ] && cd "$_j_dir" - return $_j_ret - } - - alias kak="~/src/github.com/mawww/kakoune/src/kak" - - export EDITOR=$(which kak) - export GPG_TTY=$(tty) - - - eval "$(h --setup ~/src)" - - ######################################### oh-my-zsh/lib/key-bindings.zsh ######################################### - # Start typing + [Up-Arrow] - fuzzy find history forward - if [[ "''${terminfo[kcuu1]}" != "" ]]; then - autoload -U up-line-or-beginning-search - zle -N up-line-or-beginning-search - bindkey "''${terminfo[kcuu1]}" up-line-or-beginning-search - fi - # Start typing + [Down-Arrow] - fuzzy find history backward - if [[ "''${terminfo[kcud1]}" != "" ]]; then - autoload -U down-line-or-beginning-search - zle -N down-line-or-beginning-search - bindkey "''${terminfo[kcud1]}" down-line-or-beginning-search - fi - - bindkey '^[[127;5u' backward-kill-word # [Ctrl-Backspace] - delete whole backward-word - bindkey '^[[127;2u' backward-kill-word # [Shift-Backspace] - delete whole backward-word - bindkey '^[[127;4u' backward-kill-line # [Shift-Alt-Backspace] - delete line up to cursor - bindkey '^[[3;5~' kill-word # [Ctrl-Delete] - delete whole forward-word - bindkey '^[[3;2~' kill-word # [Shift-Delete] - delete whole forward-word - bindkey '^[[3;4~' kill-line # [Shift-Alt-Delete] - delete line from cursor - bindkey '^[[Z' reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards - bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word - bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word - ################################################################################################################## - ''; - }; -} diff --git a/comb/blaggacao/homeSuites.nix b/comb/blaggacao/homeSuites.nix deleted file mode 100644 index 5d27056..0000000 --- a/comb/blaggacao/homeSuites.nix +++ /dev/null @@ -1,18 +0,0 @@ -let - inherit (inputs.cells) blaggacao; - - inherit (cell) homeProfiles homeModules; -in { - shell = [ - homeModules.alacritty - homeProfiles.shellPackages - homeProfiles.shellPrograms - ]; - gui = [ - homeProfiles.guiPackages - homeProfiles.guiPrograms - ]; - system = [ - homeProfiles.systemProfile - ]; -} diff --git a/comb/lina2358/colmenaConfigurations.nix b/comb/lina2358/colmenaConfigurations.nix deleted file mode 100644 index 10faaeb..0000000 --- a/comb/lina2358/colmenaConfigurations.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - lavinox = { - networking.hostName = "lavinox"; - deployment = { - allowLocalDeployment = true; - targetHost = null; - }; - imports = [cell.nixosConfigurations.lavinox]; - }; -} diff --git a/comb/lina2358/diskoConfigurations.nix b/comb/lina2358/diskoConfigurations.nix deleted file mode 100644 index c32e810..0000000 --- a/comb/lina2358/diskoConfigurations.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - lavinox = { - disk = { - nvme0n1 = { - device = "/dev/nvme0n1"; - type = "disk"; - content = { - type = "table"; - format = "gpt"; - partitions = [ - { - type = "partition"; - name = "ESP"; - start = "1MiB"; - end = "100MiB"; - bootable = true; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - } - { - name = "root"; - type = "partition"; - start = "100MiB"; - end = "100%"; - part-type = "primary"; - bootable = true; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - } - ]; - }; - }; - }; - }; -} diff --git a/comb/lina2358/hardwareProfiles.nix b/comb/lina2358/hardwareProfiles.nix deleted file mode 100644 index 333d94c..0000000 --- a/comb/lina2358/hardwareProfiles.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - lavinox = { - pkgs, - config, - lib, - ... - }: { - imports = [ - inputs.disko.nixosModules.disko - {disko.devices = cell.diskoConfigurations.lavinox;} - inputs.nixos-hardware.nixosModules.common-pc-laptop - inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd - inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate - inputs.nixos-hardware.nixosModules.common-gpu-amd - ]; - - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; - - networking.useDHCP = lib.mkDefault true; - - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - hardware.enableRedistributableFirmware = true; - hardware.enableAllFirmware = true; - boot.kernelPackages = pkgs.linuxPackages_latest; - }; -} diff --git a/comb/lina2358/nixosConfigurations.nix b/comb/lina2358/nixosConfigurations.nix deleted file mode 100644 index 15485a1..0000000 --- a/comb/lina2358/nixosConfigurations.nix +++ /dev/null @@ -1,247 +0,0 @@ -{ - lavinox = {pkgs, ...}: { - bee.system = "x86_64-linux"; - bee.pkgs = import inputs.nixos { - inherit (inputs.nixpkgs) system; - config.allowUnfree = true; - overlays = []; - }; - imports = [ - cell.hardwareProfiles.lavinox - ]; - - # swapDevices = [ - # { - # device = "/.swapfile"; - # size = 8192; # ~8GB - will be autocreated - # } - # ]; - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - nix.settings = { - auto-optimise-store = true; - allowed-users = ["@wheel"]; - trusted-users = ["root" "@wheel"]; - experimental-features = [ - "flakes" - "nix-command" - ]; - accept-flake-config = true; - }; - - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # Set your time zone. - time.timeZone = "America/Bogota"; - - # The global useDHCP flag is deprecated, therefore explicitly set to false here. - # Per-interface useDHCP will be mandatory in the future, so this generated config - # replicates the default behaviour. - networking.useDHCP = false; - networking.interfaces.wlp2s0.useDHCP = true; - networking.networkmanager.enable = true; - systemd.services.NetworkManager-wait-online = { - enable = false; - serviceConfig.TimeoutSec = 15; - wantedBy = ["network-online.target"]; - }; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # }; - - # Enable the X11 windowing system. - services.xserver = { - enable = true; - # Enable the GNOME Desktop Environment. - displayManager.gdm.enable = true; - desktopManager.gnome.enable = true; - # Enable touchpad support (enabled default in most desktopManager). - libinput.enable = true; - # Configure keymap in X11 - layout = "es"; - xkbOptions = ""; - }; - - services.sshd.enable = true; - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable sound. - sound.enable = true; - sound.mediaKeys.enable = true; - hardware.pulseaudio.enable = true; - # Enable scanning - hardware.sane.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users = { - users.lar = { - shell = pkgs.zsh; - isNormalUser = true; - initialPassword = "password123"; - extraGroups = ["wheel"]; # Enable ‘sudo’ for the user. - }; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - xclip - tty-share - alacritty - element-desktop - firefox - chromium - enpass - # Office - libreoffice - onlyoffice-bin - beancount - fava - direnv - # Git & Tools - git - gh - gitoxide - ghq - # Nix - # nil # nix language server - rnix-lsp # nix language server - alejandra # nix formatter - # Python - (python3Full.withPackages (p: - with p; [ - numpy - pandas - ptpython - requests - scipy - ])) - poetry # python project files - black # python formatter - (vscode-with-extensions.override { - vscode = vscodium; - vscodeExtensions = with vscode-extensions; - [] - ++ - # When the extension is already available in the default extensions set. - [ - yzhang.markdown-all-in-one - editorconfig.editorconfig - ms-python.python - ms-python.vscode-pylance - ms-pyright.pyright - jnoortheen.nix-ide # TODO: how to configure - timonwong.shellcheck - marp-team.marp-vscode - kubukoz.nickel-syntax - ms-vscode-remote.remote-ssh - ] - # Concise version from the vscode market place when not available in the default set. - ++ vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "beancount"; - publisher = "Lencerf"; - version = "0.9.1"; - sha256 = "sha256-88hSGTcjFx0n+tncGSoCgprNNnMihYZ6mSJc267thwE="; - } - { - name = "gitlab-workflow"; - publisher = "GitLab"; - version = "3.56.0"; - sha256 = "sha256-jWNX/S+cCgQmjRKCN9osffBlJJhrKa65yhTt1z5+8VQ="; - } - ]; - }) - ]; - environment.sessionVariables = { - PYTHONSTARTUP = let - startup = - pkgs.writers.writePython3 "ptpython.py" - { - libraries = with pkgs.python3Packages; [ptpython]; - } '' - from __future__ import unicode_literals - from pygments.token import Token - from ptpython.layout import CompletionVisualisation - import sys - ${builtins.readFile ./ptconfig.py} - try: - from ptpython.repl import embed - except ImportError: - print("ptpython is not available: falling back to standard prompt") - else: - sys.exit(embed(globals(), locals(), configure=configure)) - ''; - in "${startup}"; - }; - - # Programs configuration - programs.starship.enable = true; - programs.nix-ld.enable = true; # quality of life for downloaded programs - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestions.enable = true; - autosuggestions.async = true; - syntaxHighlighting.enable = true; - shellInit = '' - eval "$(direnv hook zsh)" - ''; - }; - programs.git = { - enable = true; - config = { - user.name = "Lina Avendaño"; - user.email = "lina8823@gmail.com"; - init.defaultBranch = "main"; - core.autocrlf = "input"; - pull.rebase = true; - rebase.autosquash = true; - rerere.enable = true; - }; - }; - programs.ssh = { - extraConfig = '' - Host github.com - User git - Hostname github.com - IdentityFile ~/.ssh/lar - Host gitlab.com - PreferredAuthentications publickey - IdentityFile ~/.ssh/lar - ''; - }; - programs.chromium = { - enable = true; - extensions = [ - # UID of extension - "kmcfomidfpdkfieipokbalgegidffkal" # EnPass - "bpconcjcammlapcogcnnelfmaeghhagj" # Nimbus - ]; - }; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # networking.firewall.enable = false; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "22.05"; # Did you read the comment? - }; -} diff --git a/comb/lina2358/ptconfig.py b/comb/lina2358/ptconfig.py deleted file mode 100644 index 2a67f3d..0000000 --- a/comb/lina2358/ptconfig.py +++ /dev/null @@ -1,164 +0,0 @@ -__all__ = ("configure",) - - -def configure(repl): - """ - Configuration method. This is called during the start-up of ptpython. - :param repl: `PythonRepl` instance. - """ - # Show function signature (bool). - repl.show_signature = True - - # Show docstring (bool). - repl.show_docstring = True - - # Show the "[Meta+Enter] Execute" message when pressing [Enter] only - # inserts a newline instead of executing the code. - repl.show_meta_enter_message = True - - # Show completions. (NONE, POP_UP, MULTI_COLUMN or TOOLBAR) - repl.completion_visualisation = CompletionVisualisation.POP_UP - - # When CompletionVisualisation.POP_UP has been chosen, use this - # scroll_offset in the completion menu. - repl.completion_menu_scroll_offset = 0 - - # Show line numbers (when the input contains multiple lines.) - repl.show_line_numbers = False - - # Show status bar. - repl.show_status_bar = True - - # When the sidebar is visible, also show the help text. - repl.show_sidebar_help = True - - # Swap light/dark colors on or off - repl.swap_light_and_dark = False - - # Highlight matching parethesis. - repl.highlight_matching_parenthesis = True - - # Line wrapping. (Instead of horizontal scrolling.) - repl.wrap_lines = True - - # Mouse support. - repl.enable_mouse_support = True - - # Complete while typing. (Don't require tab before the - # completion menu is shown.) - repl.complete_while_typing = True - - # Fuzzy and dictionary completion. - repl.enable_fuzzy_completion = False - repl.enable_dictionary_completion = False - - # Vi mode. - repl.vi_mode = True - - # Paste mode. (When True, don't insert whitespace after new line.) - repl.paste_mode = False - - # Use the classic prompt. (Display '>>>' instead of 'In [1]'.) - repl.prompt_style = "classic" # 'classic' or 'ipython' - - # Don't insert a blank line after the output. - repl.insert_blank_line_after_output = True - - # History Search. - # When True, going back in history will filter the history on the records - # starting with the current input. (Like readline.) - # Note: When enable, please disable the `complete_while_typing` option. - # otherwise, when there is a completion available, the arrows will - # browse through the available completions instead of the history. - repl.enable_history_search = False - - # Enable auto suggestions. (Pressing right arrow will complete the input, - # based on the history.) - repl.enable_auto_suggest = False - - # Enable open-in-editor. Pressing C-X C-E in emacs mode or 'v' in - # Vi navigation mode will open the input in the current editor. - repl.enable_open_in_editor = True - - # Enable system prompt. Pressing meta-! will display the system prompt. - # Also enables Control-Z suspend. - repl.enable_system_bindings = True - - # Ask for confirmation on exit. - repl.confirm_exit = True - - # Enable input validation. (Don't try to execute when the input contains - # syntax errors.) - repl.enable_input_validation = True - - # Use this colorscheme for the code. - repl.use_code_colorscheme("monokai") - - # Set color depth (keep in mind that not all terminals support true color). - - # repl.color_depth = 'DEPTH_1_BIT' # Monochrome. - # repl.color_depth = 'DEPTH_4_BIT' # ANSI colors only. - # repl.color_depth = "DEPTH_8_BIT" # The default, 256 colors. - repl.color_depth = "DEPTH_24_BIT" # True color. - - # Syntax. - repl.enable_syntax_highlighting = True - - # Install custom colorscheme named 'my-colorscheme' and use it. - """ - repl.install_ui_colorscheme('my-colorscheme', _custom_ui_colorscheme) - repl.use_ui_colorscheme('my-colorscheme') - """ - - # Add custom key binding for PDB. - """ - @repl.add_key_binding(Keys.ControlB) - def _(event): - ' Pressing Control-B will insert "pdb.set_trace()" ' - event.cli.current_buffer.insert_text('\nimport pdb; pdb.set_trace()\n') - """ - - # Typing ControlE twice should also execute the current command. - # (Alternative for Meta-Enter.) - """ - @repl.add_key_binding(Keys.ControlE, Keys.ControlE) - def _(event): - event.current_buffer.validate_and_handle() - """ - - # Typing 'jj' in Vi Insert mode, should send escape. (Go back to navigation - # mode.) - """ - @repl.add_key_binding('j', 'j', filter=ViInsertMode()) - def _(event): - " Map 'jj' to Escape. " - event.cli.key_processor.feed(KeyPress(Keys.Escape)) - """ - - # Custom key binding for some simple autocorrection while typing. - """ - corrections = { - 'impotr': 'import', - 'pritn': 'print', - } - @repl.add_key_binding(' ') - def _(event): - ' When a space is pressed. Check & correct word before cursor. ' - b = event.cli.current_buffer - w = b.document.get_word_before_cursor() - if w is not None: - if w in corrections: - b.delete_before_cursor(count=len(w)) - b.insert_text(corrections[w]) - b.insert_text(' ') - """ - - -# Custom colorscheme for the UI. See `ptpython/layout.py` and -# `ptpython/style.py` for all possible tokens. -_custom_ui_colorscheme = { - # Blue prompt. - Token.Layout.Prompt: "bg:#eeeeff #000000 bold", - # Make the status toolbar red. - Token.Toolbar.Status: "bg:#ff0000 #000000", -} diff --git a/flake.lock b/flake.lock index ce38be5..a15bc74 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,6 @@ { "nodes": { - "blank": { + "colmena": { "locked": { "lastModified": 1625557891, "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", @@ -15,335 +15,58 @@ "type": "github" } }, - "colmena": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": [ - "std", - "flake-utils" - ], - "nix-eval-jobs": "nix-eval-jobs", - "nixpkgs": [ - "nixpkgs" - ], - "stable": [ - "std", - "blank" - ] - }, - "locked": { - "lastModified": 1666555794, - "narHash": "sha256-MfGeJoRypj7RzvfsTohCJHEHGw+//EVCP08BU3HfvCM=", - "owner": "zhaofengli", - "repo": "colmena", - "rev": "2bd563e847817a3e96b2aa9932109c83bc64e566", - "type": "github" - }, - "original": { - "owner": "zhaofengli", - "repo": "colmena", - "type": "github" - } - }, - "devshell": { - "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], - "nixpkgs": [ - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1663445644, - "narHash": "sha256-+xVlcK60x7VY1vRJbNUEAHi17ZuoQxAIH4S4iUFUGBA=", - "owner": "numtide", - "repo": "devshell", - "rev": "e3dc3e21594fe07bdb24bdf1c8657acaa4cb8f66", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, "disko": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, "locked": { - "lastModified": 1668081890, - "narHash": "sha256-xm7yDuwuQLL/F0tJycutdprQekpETy3DssqfTudM9NI=", - "owner": "nix-community", - "repo": "disko", - "rev": "d7e25ced8a15554e3afb2eb9b1800de271efbd87", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "disko", - "type": "github" - } - }, - "dmerge": { - "inputs": { - "nixlib": [ - "std", - "nixpkgs" - ], - "yants": [ - "std", - "yants" - ] - }, - "locked": { - "lastModified": 1659548052, - "narHash": "sha256-fzI2gp1skGA8mQo/FBFrUAtY0GQkAIAaV/V127TJPyY=", + "lastModified": 1625557891, + "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", "owner": "divnix", - "repo": "data-merge", - "rev": "d160d18ce7b1a45b88344aa3f13ed1163954b497", + "repo": "blank", + "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", "type": "github" }, "original": { "owner": "divnix", - "repo": "data-merge", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "home-22-05": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1667182798, - "narHash": "sha256-9kQpjZCQaMLiOyPqnj332Bml4XjFWCGFUqeLTVclMBI=", - "owner": "blaggacao", - "repo": "home-manager", - "rev": "20194a35604169703d5ef8ec7353c44b612cfb14", - "type": "github" - }, - "original": { - "owner": "blaggacao", - "ref": "release-22.05", - "repo": "home-manager", - "type": "github" - } - }, - "n2c": { - "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], - "nixpkgs": [ - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1665039323, - "narHash": "sha256-SAh3ZjFGsaCI8FRzXQyp56qcGdAqgKEfJWPCQ0Sr7tQ=", - "owner": "nlewo", - "repo": "nix2container", - "rev": "b008fe329ffb59b67bf9e7b08ede6ee792f2741a", - "type": "github" - }, - "original": { - "owner": "nlewo", - "repo": "nix2container", - "type": "github" - } - }, - "nix-eval-jobs": { - "inputs": { - "flake-utils": [ - "colmena", - "flake-utils" - ], - "nixpkgs": [ - "colmena", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660713017, - "narHash": "sha256-w6KLNkT/2fI7UvPg3NoKj7gve4CgUHpyWOFq0BUwW7o=", - "owner": "zhaofengli", - "repo": "nix-eval-jobs", - "rev": "b4c078a4870c5b1a5b74420ca1dca41f4d75b7cc", - "type": "github" - }, - "original": { - "owner": "zhaofengli", - "ref": "colmena", - "repo": "nix-eval-jobs", - "type": "github" - } - }, - "nixago": { - "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], - "nixago-exts": [ - "std", - "blank" - ], - "nixpkgs": [ - "std", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1661824785, - "narHash": "sha256-/PnwdWoO/JugJZHtDUioQp3uRiWeXHUdgvoyNbXesz8=", - "owner": "nix-community", - "repo": "nixago", - "rev": "8c1f9e5f1578d4b2ea989f618588d62a335083c3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago", - "type": "github" - } - }, - "nixgl": { - "inputs": { - "flake-utils": [ - "std", - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1661367362, - "narHash": "sha256-Qc8MXcV+YCPREu8kk6oggk23ZBKLqeQRAIsLbHEviPE=", - "owner": "guibou", - "repo": "nixGL", - "rev": "7165ffbccbd2cf4379b6cd6d2edd1620a427e5ae", - "type": "github" - }, - "original": { - "owner": "guibou", - "repo": "nixGL", + "repo": "blank", "type": "github" } }, - "nixos-22-05": { + "home-manager": { "locked": { - "lastModified": 1666488099, - "narHash": "sha256-DANs2epN5QgvxWzH7xF3dzb4WE0lEuMLrMEu/vPmQxw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "f9115594149ebcb409a42e303bec4956814a8419", + "lastModified": 1625557891, + "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", + "owner": "divnix", + "repo": "blank", + "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", "type": "github" }, "original": { - "owner": "nixos", - "ref": "release-22.05", - "repo": "nixpkgs", + "owner": "divnix", + "repo": "blank", "type": "github" } }, "nixos-generators": { - "inputs": { - "nixlib": [ - "nixpkgs" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1666559224, - "narHash": "sha256-wi1b6PZ4QhLcrpZTXb+hqWdyQTcPz9UMvHdKB+W1Ys0=", - "owner": "blaggacao", - "repo": "nixos-generators", - "rev": "20c21b9880628f61ce1d2e95ca393691d40ced2e", - "type": "github" - }, - "original": { - "owner": "blaggacao", - "repo": "nixos-generators", - "type": "github" - } - }, - "nixos-hardware": { "locked": { - "lastModified": 1667585378, - "narHash": "sha256-cvOwucrjBaAkaGk3FunG+MQiwiSBeIVTtO5n/YavpC0=", - "owner": "nixos", - "repo": "nixos-hardware", - "rev": "6b35a59c19ddbbeb229fcd1d3dcd422dcc0fa927", + "lastModified": 1625557891, + "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", + "owner": "divnix", + "repo": "blank", + "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", "type": "github" }, "original": { - "owner": "nixos", - "repo": "nixos-hardware", + "owner": "divnix", + "repo": "blank", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1658644204, - "narHash": "sha256-MWyfCH9K3eVTXJUxBi67OQSAh9jJAnvWklM6qm4j8w8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "2f0c3be57c348f4cfd8820f2d189e29a685d9c41", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1666424192, - "narHash": "sha256-rb/a7Kg9s31jqkvdOQHFrUc5ig5kB+O2ZKB8mjU2kW8=", + "lastModified": 1675940568, + "narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4f8287f3d597c73b0d706cfad028c2d51821f64d", + "rev": "6ccc4a59c3f1b56d039d93da52696633e641bc71", "type": "github" }, "original": { @@ -355,11 +78,11 @@ }, "nosys": { "locked": { - "lastModified": 1667698628, - "narHash": "sha256-6Q/aeHNCXTsGGb0yoc6CEmyK+9aaMnZkmw2/6jCV39s=", + "lastModified": 1668010795, + "narHash": "sha256-JBDVBnos8g0toU7EhIIqQ1If5m/nyBqtHhL3sicdPwI=", "owner": "divnix", "repo": "nosys", - "rev": "cef00e1e6d372874c976cabcee52ab89a0ab1ced", + "rev": "feade0141487801c71ff55623b421ed535dbdefa", "type": "github" }, "original": { @@ -368,49 +91,8 @@ "type": "github" } }, - "root": { - "inputs": { - "colmena": "colmena", - "disko": "disko", - "home": [ - "home-22-05" - ], - "home-22-05": "home-22-05", - "nixgl": "nixgl", - "nixos": [ - "nixos-22-05" - ], - "nixos-22-05": "nixos-22-05", - "nixos-generators": "nixos-generators", - "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2", - "std": "std" - } - }, - "std": { + "paisano": { "inputs": { - "arion": [ - "std", - "blank" - ], - "blank": "blank", - "devshell": "devshell", - "dmerge": "dmerge", - "flake-utils": "flake-utils", - "makes": [ - "std", - "blank" - ], - "mdbook-kroki-preprocessor": [ - "std", - "blank" - ], - "microvm": [ - "std", - "blank" - ], - "n2c": "n2c", - "nixago": "nixago", "nixpkgs": [ "nixpkgs" ], @@ -418,32 +100,42 @@ "yants": "yants" }, "locked": { - "lastModified": 1667706640, - "narHash": "sha256-AcTYlitotiOlu0ypjT4XCsTqake5zkGNLQXD8rx3E7s=", + "lastModified": 1677298389, + "narHash": "sha256-gNOsmmr3HiNXFaQ+Rc4USFoKksS+6KKZpCTThnnwW6Q=", "owner": "divnix", - "repo": "std", - "rev": "f2b74537c1fe555147b3ade70aa1f9bf945c4a00", + "repo": "paisano", + "rev": "687683ae1d9028135a43ed1f9cc3954cf55fc689", "type": "github" }, "original": { "owner": "divnix", - "repo": "std", + "repo": "paisano", "type": "github" } }, + "root": { + "inputs": { + "colmena": "colmena", + "disko": "disko", + "home-manager": "home-manager", + "nixos-generators": "nixos-generators", + "nixpkgs": "nixpkgs", + "paisano": "paisano" + } + }, "yants": { "inputs": { "nixpkgs": [ - "std", + "paisano", "nixpkgs" ] }, "locked": { - "lastModified": 1667096281, - "narHash": "sha256-wRRec6ze0gJHmGn6m57/zhz/Kdvp9HS4Nl5fkQ+uIuA=", + "lastModified": 1677285314, + "narHash": "sha256-hlAcg2514zKrPu8jn24BUsIjjvXvCLdw1jvKgBTpqko=", "owner": "divnix", "repo": "yants", - "rev": "d18f356ec25cb94dc9c275870c3a7927a10f8c3c", + "rev": "9eab24b273ce021406c852166c216b86e2bb4ec4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bde6842..4c850b6 100644 --- a/flake.nix +++ b/flake.nix @@ -1,128 +1,32 @@ +# SPDX-FileCopyrightText: 2022 The Standard Authors +# +# SPDX-License-Identifier: Unlicense { description = "The Hive - The secretly open NixOS-Society"; - inputs.std.url = "github:divnix/std"; - inputs.std.inputs.nixpkgs.follows = "nixpkgs"; - inputs.std.inputs.mdbook-kroki-preprocessor.follows = "std/blank"; - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - # tools - inputs = { - nixos-generators.url = "github:blaggacao/nixos-generators"; - nixos-generators.inputs.nixpkgs.follows = "nixpkgs"; - nixos-generators.inputs.nixlib.follows = "nixpkgs"; - colmena.url = "github:zhaofengli/colmena"; - colmena.inputs.nixpkgs.follows = "nixpkgs"; - colmena.inputs.stable.follows = "std/blank"; - colmena.inputs.flake-utils.follows = "std/flake-utils"; - nixgl.url = "github:guibou/nixGL"; - nixgl.inputs.nixpkgs.follows = "nixpkgs"; - nixgl.inputs.flake-utils.follows = "std/flake-utils"; - disko.url = "github:nix-community/disko"; - disko.inputs.nixpkgs.follows = "nixpkgs"; - nixos-hardware.url = "github:nixos/nixos-hardware"; + inputs.paisano = { + url = "github:divnix/paisano"; + inputs.nixpkgs.follows = "nixpkgs"; }; - # nixpkgs & home-manager - inputs = { - nixos.follows = "nixos-22-05"; - home.follows = "home-22-05"; + # override downstream with inputs.hive.inputs.nixpkgs.follows = ... + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - nixos-22-05.url = "github:nixos/nixpkgs/release-22.05"; - home-22-05.url = "github:blaggacao/home-manager/release-22.05"; # some temp fixes + inputs = { + colmena.url = "github:divnix/blank"; + disko.url = "github:divnix/blank"; + nixos-generators.url = "github:divnix/blank"; + home-manager.url = "github:divnix/blank"; }; - outputs = { - std, - self, - ... - } @ inputs: - std.growOn { + outputs = inputs: let + blockTypes = import ./src/blocktypes.nix {inherit (inputs) nixpkgs;}; + collect = import ./src/collect.nix { inherit inputs; - cellsFrom = ./comb; - # debug = ["cells" "x86_64-linux"]; - cellBlocks = with std.blockTypes; [ - # modules implement - (functions "nixosModules") - (functions "homeModules") - (functions "devshellModules") - - # profiles activate - (functions "hardwareProfiles") - (functions "nixosProfiles") - (functions "homeProfiles") - (functions "devshellProfiles") - - # suites aggregate profiles - (functions "nixosSuites") - (functions "homeSuites") - - # configurations can be deployed - (data "nixosConfigurations") - (data "colmenaConfigurations") - (data "homeConfigurations") - (data "diskoConfigurations") - - # devshells can be entered - (devshells "devshells") - - # jobs can be run - (runnables "jobs") - - # library holds shared knowledge made code - (functions "library") - ]; - nixpkgsConfig = { - allowUnfree = true; - }; - } - # soil - { - packages.x86_64-linux = {inherit (inputs.disko.packages.x86_64-linux) disko;}; - devShells = std.harvest self ["_QUEEN" "devshells"]; - } - { - # tool: colmena -- "fill the jar on the soil with the honey!" - colmenaHive = let - makeHoneyFrom = import ./make-honey.nix { - inherit (inputs) colmena nixpkgs; - cellBlock = "colmenaConfigurations"; - }; - in - makeHoneyFrom self; - - # tool: nixos-generators -- "get drunk like a bear!" - nixosConfigurations = let - makeMeadFrom = import ./make-mead.nix { - inherit (inputs) nixpkgs; - cellBlock = "nixosConfigurations"; - }; - in - makeMeadFrom self; - - # tool: home-manager -- "drunken sailor, sunken sailor; honeymoon pantaloon." - homeConfigurations = let - makeMoonshineFrom = import ./make-moonshine.nix { - inherit (inputs) nixpkgs; - cellBlock = "homeConfigurations"; - }; - in - makeMoonshineFrom self; - - # tool: disko -- "Tiganizatia, tiganizatia - disko, disko partizani." - diskoConfigurations = let - makeShantyFrom = import ./make-shanty.nix { - inherit (inputs) nixpkgs; - cellBlock = "diskoConfigurations"; - }; - in - makeShantyFrom self; + inherit (inputs) nixpkgs; }; - - # --- Flake Local Nix Configuration ---------------------------- - # TODO: adopt spongix - nixConfig = { - extra-substituters = []; - extra-trusted-public-keys = []; + in { + inherit blockTypes collect; + inherit (inputs.paisano) grow growOn pick harvest winnow; }; - # -------------------------------------------------------------- } diff --git a/src/actions.nix b/src/actions.nix new file mode 100644 index 0000000..852498e --- /dev/null +++ b/src/actions.nix @@ -0,0 +1,61 @@ +{nixpkgs}: let + l = nixpkgs.lib // builtins; + mkCommand = import ./mkCommand.nix {inherit nixpkgs;}; + + contextFreeDrv = target: l.unsafeDiscardStringContext target.drvPath; + + build = system: target: + mkCommand system { + name = "build"; + description = "build it"; + command = '' + # ${target} + nix build ${contextFreeDrv target} + ''; + targetDrv = target.drvPath; + proviso = + # bash + '' + function proviso() { + local -n input=$1 + local -n output=$2 + + local drvs + local -a uncached + + # FIXME: merge upstream to avoid any need for runtime context + command nix build github:divnix/nix-uncached/v2.13.1 + + drvs=$(command jq -r '.targetDrv | select(. != "null")' <<< "''${input[@]}") + + uncached_json=$(result/bin/nix-uncached $drvs) + + mapfile -t uncached < <(command jq -r 'to_entries[]|select(.value != [])|.key' <<< "$uncached_json") + + if [[ -n ''${uncached[*]} ]]; then + local list filtered + + list=$(command jq -ncR '[inputs]' <<< "''${uncached[@]}") + filtered=$(command jq -c 'select([.targetDrv] | inside($p))' --argjson p "$list" <<< "''${input[@]}") + + output=$(command jq -cs '. += $p' --argjson p "$output" <<< "$filtered") + fi + } + ''; + }; + + run = system: target: let + programName = + target.meta.mainProgram + or (l.getName target); + in + mkCommand system { + name = "run"; + description = "run it"; + # this is the exact sequence mentioned by the `nix run` docs + # and so should be compatible + command = '' + ${target.program or "${target}/bin/${programName}"} "$@" + ''; + }; +in {inherit build run;} diff --git a/src/ansi.nix b/src/ansi.nix new file mode 100644 index 0000000..0edbc45 --- /dev/null +++ b/src/ansi.nix @@ -0,0 +1,17 @@ +# Ansi escape codes +let + # Nix strings only support \t, \r and \n as escape codes, so actually store + # the literal escape "ESC" code. + inherit (builtins) foldl' genList; + esc = ""; +in + { + reset = "${esc}[0m"; + bold = "${esc}[1m"; + un-bold = "${esc}[21m"; + italic = "${esc}[3m"; + un-italic = "${esc}[23m"; + underline = "${esc}[4m"; + un-underline = "${esc}[24m"; + } + // (foldl' (x: y: x // {"${toString y}" = "${esc}[38;5;${toString y}m";}) {} (genList (x: x) 256)) diff --git a/src/blocktypes.nix b/src/blocktypes.nix new file mode 100644 index 0000000..5b47f8c --- /dev/null +++ b/src/blocktypes.nix @@ -0,0 +1,9 @@ +{nixpkgs}: let + sharedActions = import ./actions.nix {inherit nixpkgs;}; + mkCommand = import ./mkCommand.nix {inherit nixpkgs;}; +in { + colmenaConfigurations = import ./blocktypes/colmenaConfigurations.nix {inherit nixpkgs mkCommand;}; + diskoConfigurations = import ./blocktypes/diskoConfigurations.nix {inherit nixpkgs mkCommand;}; + homeConfigurations = import ./blocktypes/homeConfigurations.nix {inherit nixpkgs mkCommand;}; + nixosConfigurations = import ./blocktypes/nixosConfigurations.nix {inherit nixpkgs mkCommand;}; +} diff --git a/src/blocktypes/colmenaConfigurations.nix b/src/blocktypes/colmenaConfigurations.nix new file mode 100644 index 0000000..e0cb8b8 --- /dev/null +++ b/src/blocktypes/colmenaConfigurations.nix @@ -0,0 +1,17 @@ +{ + nixpkgs, + mkCommand, +}: let + l = nixpkgs.lib // builtins; + /* + Use the colmenaConfigurations Blocktype for + final definitions of your NixOS hosts, + including colmena-specific deployment config. + */ + colmenaConfigurations = { + name = "colmenaConfigurations"; + type = "colmenaConfiguration"; + # colmena action? + }; +in + colmenaConfigurations diff --git a/src/blocktypes/diskoConfigurations.nix b/src/blocktypes/diskoConfigurations.nix new file mode 100644 index 0000000..4a9acac --- /dev/null +++ b/src/blocktypes/diskoConfigurations.nix @@ -0,0 +1,18 @@ +{ + nixpkgs, + mkCommand, +}: let + l = nixpkgs.lib // builtins; + /* + Use the diskoConfigurations Blocktype for + final definitions of your standalone disko + formatting configurations / profiles. + */ + diskoConfigurations = { + name = "diskoConfigurations"; + type = "diskoConfiguration"; + # disko's CLI actions? + # maybe even more things, like remote formatting commands? + }; +in + diskoConfigurations diff --git a/src/blocktypes/homeConfigurations.nix b/src/blocktypes/homeConfigurations.nix new file mode 100644 index 0000000..4ff8afb --- /dev/null +++ b/src/blocktypes/homeConfigurations.nix @@ -0,0 +1,16 @@ +{ + nixpkgs, + mkCommand, +}: let + l = nixpkgs.lib // builtins; + /* + Use the homeConfigurations Blocktype for + final definitions of your HomeManager environments. + */ + homeConfigurations = { + name = "homeConfigurations"; + type = "homeConfiguration"; + # homemanager's actions? + }; +in + homeConfigurations diff --git a/src/blocktypes/nixosConfigurations.nix b/src/blocktypes/nixosConfigurations.nix new file mode 100644 index 0000000..6b968c4 --- /dev/null +++ b/src/blocktypes/nixosConfigurations.nix @@ -0,0 +1,18 @@ +{ + nixpkgs, + mkCommand, +}: let + l = nixpkgs.lib // builtins; + /* + Use the nixosConfigurations Blocktype for + final definitions of your NixOS hosts. + */ + nixosConfigurations = { + name = "nixosConfigurations"; + type = "nixosConfiguration"; + # nixosGenerator's actions? + # microvm action? + # nixos-rebuild action? + }; +in + nixosConfigurations diff --git a/make-honey.nix b/src/collect-colmena.nix similarity index 92% rename from make-honey.nix rename to src/collect-colmena.nix index fe3e846..19dc252 100644 --- a/make-honey.nix +++ b/src/collect-colmena.nix @@ -1,12 +1,15 @@ { - colmena, + inputs, nixpkgs, - cellBlock ? "colmenaConfigurations", + cellBlock, }: let l = nixpkgs.lib // builtins; + inherit (inputs) colmena; inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) pasteurize stir beeOptions; colmenaModules = [ + # these modules are tied to the below schemaversion + # so we fix them here colmena.nixosModules.assertionModule colmena.nixosModules.keyChownModule colmena.nixosModules.keyServiceModule diff --git a/make-shanty.nix b/src/collect-disko.nix similarity index 76% rename from make-shanty.nix rename to src/collect-disko.nix index 5510d61..b4d2f44 100644 --- a/make-shanty.nix +++ b/src/collect-disko.nix @@ -1,6 +1,7 @@ { + inputs, # unused for now nixpkgs, - cellBlock ? "diskoConfigurations", + cellBlock, }: let l = nixpkgs.lib // builtins; inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) sing; diff --git a/make-moonshine.nix b/src/collect-home.nix similarity index 94% rename from make-moonshine.nix rename to src/collect-home.nix index 4cb6d9f..ee24067 100644 --- a/make-moonshine.nix +++ b/src/collect-home.nix @@ -1,6 +1,7 @@ { + inputs, # unused for now nixpkgs, - cellBlock ? "homeConfigurations", + cellBlock, }: let l = nixpkgs.lib // builtins; inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) cure shake showAssertions; diff --git a/make-mead.nix b/src/collect-nixos.nix similarity index 91% rename from make-mead.nix rename to src/collect-nixos.nix index 4bd8ed3..ffc659f 100644 --- a/make-mead.nix +++ b/src/collect-nixos.nix @@ -1,6 +1,7 @@ { + inputs, # unused for now nixpkgs, - cellBlock ? "nixosConfigurations", + cellBlock, }: let l = nixpkgs.lib // builtins; inherit (import ./pasteurize.nix {inherit nixpkgs cellBlock;}) pasteurize stir beeOptions; diff --git a/src/collect.nix b/src/collect.nix new file mode 100644 index 0000000..f4e3acd --- /dev/null +++ b/src/collect.nix @@ -0,0 +1,58 @@ +{ + inputs, + nixpkgs, +}: let + requireInput = import ./requireInput.nix {inherit inputs;}; + dispatch = { + /* + Modules declare an interface into a problem domain + */ + nixosModules = throw "not implemented yet"; + homeModules = throw "not implemented yet"; + shellModules = throw "not implemented yet"; + /* + Profiles define values on that interface + */ + hardwareProfiles = throw "not implemented yet"; + nixosProfiles = throw "not implemented yet"; + homeProfiles = throw "not implemented yet"; + shellProfiles = throw "not implemented yet"; + /* + Suites aggregate profiles into groups + */ + nixosSuites = throw "not implemented yet"; + homeSuites = throw "not implemented yet"; + shellSuites = throw "not implemented yet"; + /* + Configurations have an init-sequence and can be deployed + */ + nixosConfigurations = import ./collect-nixos.nix { + cellBlock = "nixosConfigurations"; + inherit nixpkgs inputs; + }; + colmenaConfigurations = import ./collect-colmena.nix { + cellBlock = "colmenaConfigurations"; + inherit nixpkgs; + inputs = requireInput "colmena" "github:zhaofengli/colmena" "collect \"colmenaConfigurations\""; + }; + homeConfigurations = import ./collect-home.nix { + cellBlock = "homeConfigurations"; + inherit nixpkgs inputs; + }; + diskoConfigurations = import ./collect-disko.nix { + cellBlock = "diskoConfigurations"; + inherit nixpkgs inputs; + }; + }; +in + Self: CellBlock: + if builtins.hasAttr CellBlock dispatch + then dispatch.${CellBlock} Self + else + builtins.throw '' + + `hive.collect` can't collect ${CellBlock}. + + It can collect the following cell blocks: + - ${builtins.concatStringsSep "\n - " (builtins.attrNames dispatch)} + '' diff --git a/src/mkCommand.nix b/src/mkCommand.nix new file mode 100644 index 0000000..effe3de --- /dev/null +++ b/src/mkCommand.nix @@ -0,0 +1,18 @@ +{nixpkgs}: let + mkCommand = currentSystem: args: + args + // { + command = (nixpkgs.legacyPackages.${currentSystem}.writeShellScript "${args.name}" args.command).overrideAttrs (self: { + passthru = + self.passthru + or {} + // nixpkgs.lib.optionalAttrs (args ? proviso) { + proviso = builtins.toFile "${args.name}-proviso" args.proviso; + } + // nixpkgs.lib.optionalAttrs (args ? targetDrv) { + inherit (args) targetDrv; + }; + }); + }; +in + mkCommand diff --git a/pasteurize.nix b/src/pasteurize.nix similarity index 100% rename from pasteurize.nix rename to src/pasteurize.nix diff --git a/src/requireInput.nix b/src/requireInput.nix new file mode 100644 index 0000000..0d47c30 --- /dev/null +++ b/src/requireInput.nix @@ -0,0 +1,70 @@ +{inputs}: input: url: target: let + l = inputs.nixpkgs.lib // builtins; + + # other than `divnix/blank` + isBlank = input: inputs.${input}.sourceInfo.narHash == "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4="; + + ansi = import ./ansi.nix; + + pad = n: s: let + prefix = l.concatStringsSep "" (l.genList (_: " ") n); + in + prefix + s; + + indent = s: let + n = 5; + prefix = l.concatStringsSep "" (l.genList (_: " ") n); + lines = l.splitString "\n" s; + in + l.concatStringsSep "\n${prefix}│ " lines; + + warn = let + apply = + l.replaceStrings + (map (key: "{${key}}") (l.attrNames ansi)) + (l.attrValues ansi); + in + msg: l.trace (apply "🚀 {bold}{200}Hive Input Overloading{reset}${msg}") ""; + + body = '' + In order to use ${target}, add to {bold}flake.nix{un-bold}: + + inputs.hive.inputs.${input}.url = + "${url}"; + ''; + + inputs' = let + names = l.attrNames (l.removeAttrs inputs ["self" "cells" "blank"]); + nameLengths = map l.stringLength names; + maxNameLength = + l.foldl' + (max: v: + if v > max + then v + else max) + 0 + nameLengths; + + lines = + l.map ( + name: "- ${name}${ + if isBlank name + then pad (maxNameLength - (l.stringLength name)) " | blanked out" + else "" + }" + ) + names; + in + "Declared Inputs:\n" + (l.concatStringsSep "\n" lines); +in + assert l.assertMsg (! (isBlank input)) (warn '' + + ─────┬───────────────────────────────────────────────────────────────────────── + 🏗️ │ {bold}Input Overloading for ${target}{un-bold} + ─────┼───────────────────────────────────────────────────────────────────────── + 📝 │ {italic}${indent body}{un-italic} + ─────┼───────────────────────────────────────────────────────────────────────── + 🙋 │ ${indent inputs'} + ─────┴───────────────────────────────────────────────────────────────────────── + ''); inputs +