mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-01-01 09:10:44 -06:00
Compare commits
1 commit
fa1253baa5
...
4808169e87
Author | SHA1 | Date | |
---|---|---|---|
|
4808169e87 |
18 changed files with 161 additions and 154 deletions
101
flake.lock
101
flake.lock
|
@ -18,7 +18,6 @@
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
"nixpkgs-wayland",
|
|
||||||
"nix-eval-jobs",
|
"nix-eval-jobs",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
|
@ -42,11 +41,11 @@
|
||||||
"systems": "systems_3"
|
"systems": "systems_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1709126324,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -68,11 +67,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710257359,
|
"lastModified": 1709942067,
|
||||||
"narHash": "sha256-43re5pzE/cswFAgw92/ugsB3+d5ufDaCcLtl9ztKfBo=",
|
"narHash": "sha256-DGU4zQDwIx6pXM6oHdA+89UU/QjqE05HiXOvigECJjI=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprcursor",
|
"repo": "hyprcursor",
|
||||||
"rev": "1761f6cefd77f4fcd2039d930c88d6716ddc4974",
|
"rev": "a2233d4a2a58233457712acfd88d10a2a8a85711",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -94,11 +93,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710634512,
|
"lastModified": 1710026388,
|
||||||
"narHash": "sha256-dqYzqSsGB9PhwxG2H3oVRpqAMWziVuQ7k+02ASku8T4=",
|
"narHash": "sha256-Z/ReJhaauOe+uThHB1LJ/3tJOnNxdYybS72Z8gkRWT8=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "0387528c56c4d9faf93946cbc9426973de6ef61b",
|
"rev": "335506d5557b91a0baf974750c353443841e691b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -115,11 +114,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710415616,
|
"lastModified": 1709391291,
|
||||||
"narHash": "sha256-1qVByzzCcKoCmP8ReUSAjKU5V9pfTLHQIM4WI1tvQ9E=",
|
"narHash": "sha256-NJwAgXRKLVuO3YLkGxXIanLvTKN+cJsYwbLoWOa7ODk=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "contrib",
|
"repo": "contrib",
|
||||||
"rev": "75420d09f93346d9d23d5a1e26b42699f6b66cd6",
|
"rev": "2d4ece4a008feefddc194bde785b1d39f987b5a7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -207,11 +206,11 @@
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710184940,
|
"lastModified": 1709467759,
|
||||||
"narHash": "sha256-FzYm4td3FJfzOAuEkCXt3KdUgZuA072OAQXqIq+IAMo=",
|
"narHash": "sha256-ojIpNROGKk56wyvpMAlBVor3CvPez3pFMORrocxW4io=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "lib-aggregate",
|
"repo": "lib-aggregate",
|
||||||
"rev": "45b75bf534592c0c1c881a1c447f7fdb37a87eaf",
|
"rev": "206e40afdc468d0658e30e1644e2473dc6285cf2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -224,7 +223,9 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nix-github-actions": "nix-github-actions",
|
"nix-github-actions": "nix-github-actions",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -244,7 +245,6 @@
|
||||||
"nix-github-actions": {
|
"nix-github-actions": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs-wayland",
|
|
||||||
"nix-eval-jobs",
|
"nix-eval-jobs",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
|
@ -270,11 +270,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710120787,
|
"lastModified": 1709906691,
|
||||||
"narHash": "sha256-tlLuB73OCOKtU2j83bQzSYFyzjJo3rjpITZE5MoofG8=",
|
"narHash": "sha256-206XMy1NGW42bnHukJl5W2F90yHNoJc7+H3i+/8i2Pg=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "e76ff2df6bfd2abe06abd8e7b9f217df941c1b07",
|
"rev": "2ad5ebce1e1be47a8cf330d85265ac09ffa15178",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -285,11 +285,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710534455,
|
"lastModified": 1709968316,
|
||||||
"narHash": "sha256-huQT4Xs0y4EeFKn2BTBVYgEwJSv8SDlm82uWgMnCMmI=",
|
"narHash": "sha256-4rZEtEDT6jcgRaqxsatBeds7x1PoEiEjb6QNGb4mNrk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9af9c1c87ed3e3ed271934cb896e0cdd33dae212",
|
"rev": "0e7f98a5f30166cbed344569426850b21e4091d4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -301,11 +301,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710031547,
|
"lastModified": 1709426687,
|
||||||
"narHash": "sha256-pkUg3hOKuGWMGF9WEMPPN/G4pqqdbNGJQ54yhyQYDVY=",
|
"narHash": "sha256-jLBZmwXf0WYHzLkmEMq33bqhX55YtT5edvluFr0RcSA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "630ebdc047ca96d8126e16bb664c7730dc52f6e6",
|
"rev": "7873d84a89ae6e4841528ff7f5697ddcb5bdfe6c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -318,17 +318,19 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"lib-aggregate": "lib-aggregate",
|
"lib-aggregate": "lib-aggregate",
|
||||||
"nix-eval-jobs": "nix-eval-jobs",
|
"nix-eval-jobs": [
|
||||||
|
"nix-eval-jobs"
|
||||||
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710631003,
|
"lastModified": 1709990107,
|
||||||
"narHash": "sha256-6bOCj2BUwOYDO1Lq3DgwIfrdUiieKkm1fCHFQRkLK4Y=",
|
"narHash": "sha256-fuAqFR/lGwKOxMw7wCK7xzUv/JhS8v9bdNQJ9KCE5HQ=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs-wayland",
|
"repo": "nixpkgs-wayland",
|
||||||
"rev": "bce941770aa96005f08c7b60851037352bf76156",
|
"rev": "c737af27135864461e68214f7bbe9222f7d859fb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -337,22 +339,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1703134684,
|
|
||||||
"narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "d6863cbcbbb80e71cecfc03356db1cda38919523",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pinix": {
|
"pinix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -377,27 +363,11 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"hyprland-contrib": "hyprland-contrib",
|
"hyprland-contrib": "hyprland-contrib",
|
||||||
|
"nix-eval-jobs": "nix-eval-jobs",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-wayland": "nixpkgs-wayland",
|
"nixpkgs-wayland": "nixpkgs-wayland",
|
||||||
"pinix": "pinix",
|
"pinix": "pinix"
|
||||||
"stable": "stable"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1710420202,
|
|
||||||
"narHash": "sha256-MvFKESbq4rUWuaf2RKPNYENaSZEw/jaCLo2gU6oREcM=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "878ef7d9721bee9f81f8a80819f9211ad1f993da",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-23.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
@ -448,7 +418,6 @@
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs-wayland",
|
|
||||||
"nix-eval-jobs",
|
"nix-eval-jobs",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
|
|
13
flake.nix
13
flake.nix
|
@ -9,14 +9,21 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
stable.url = "github:nixos/nixpkgs/nixos-23.11";
|
|
||||||
|
|
||||||
hyprland.url = "github:hyprwm/Hyprland/main";
|
hyprland.url = "github:hyprwm/Hyprland/main";
|
||||||
hyprland.inputs.nixpkgs.follows = "nixpkgs";
|
hyprland.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
hyprland-contrib.url = "github:hyprwm/contrib";
|
hyprland-contrib.url = "github:hyprwm/contrib";
|
||||||
hyprland-contrib.inputs.nixpkgs.follows = "nixpkgs";
|
hyprland-contrib.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
|
||||||
nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs";
|
nixpkgs-wayland = {
|
||||||
|
url = "github:nix-community/nixpkgs-wayland";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.nix-eval-jobs.follows = "nix-eval-jobs";
|
||||||
|
};
|
||||||
|
|
||||||
|
nix-eval-jobs.url = "github:nix-community/nix-eval-jobs";
|
||||||
|
nix-eval-jobs.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
pinix.url = "github:remi-dupre/pinix";
|
pinix.url = "github:remi-dupre/pinix";
|
||||||
pinix.inputs.nixpkgs.follows = "nixpkgs";
|
pinix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
}: {
|
}: {
|
||||||
imports = with self.nixosModules; [
|
imports = with self.nixosModules; [
|
||||||
nix-ld
|
nix-ld
|
||||||
|
virtualbox
|
||||||
restic
|
restic
|
||||||
docker
|
docker
|
||||||
];
|
];
|
||||||
|
|
||||||
oizys = {
|
oizys = {
|
||||||
vbox.enable = true;
|
|
||||||
desktop.enable = true;
|
desktop.enable = true;
|
||||||
vpn.enable = true;
|
vpn.enable = true;
|
||||||
languages = [
|
languages = [
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.systemd-boot.consoleMode = "max";
|
boot.loader.systemd-boot.consoleMode = "max";
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
# This option defines the first version of NixOS you have installed on this particular machine,
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
||||||
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
lib = nixpkgs.lib.extend (import ./extended.nix);
|
lib = nixpkgs.lib.extend (import ./extended.nix);
|
||||||
|
|
||||||
inherit (builtins) concatLists attrValues mapAttrs elemAt match readDir filter listToAttrs;
|
inherit (builtins) concatLists attrValues mapAttrs elemAt match readDir filter listToAttrs;
|
||||||
inherit (lib) nixosSystem genAttrs isNixFile;
|
inherit (lib) hasSuffix nixosSystem genAttrs isNixFile;
|
||||||
inherit (lib.filesystem) listFilesRecursive;
|
inherit (lib.filesystem) listFilesRecursive;
|
||||||
|
|
||||||
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||||
|
|
|
@ -2,6 +2,7 @@ final: prev: let
|
||||||
inherit (final) hasSuffix;
|
inherit (final) hasSuffix;
|
||||||
runes = import ../modules/runes;
|
runes = import ../modules/runes;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
isNixFile = path: hasSuffix ".nix" path;
|
isNixFile = path: hasSuffix ".nix" path;
|
||||||
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
|
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
|
||||||
mkRune = {
|
mkRune = {
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
qtile
|
qtile
|
||||||
hyprland
|
hyprland
|
||||||
|
|
||||||
virtualbox
|
|
||||||
|
|
||||||
gui
|
gui
|
||||||
|
|
||||||
languages
|
languages
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
vim
|
vim
|
||||||
neovim
|
neovim
|
||||||
|
|
||||||
# nixd
|
nixd
|
||||||
tree-sitter
|
tree-sitter
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkOption types literalExpression mdDoc;
|
inherit (lib) mkOption types literalExpression mdDoc;
|
||||||
|
cfg = config.oizys.languages;
|
||||||
in {
|
in {
|
||||||
imports = [./nim.nix ./tex.nix ./misc.nix ./node.nix ./python.nix];
|
imports = [./nim.nix ./tex.nix ./misc.nix ./node.nix ./python.nix];
|
||||||
options.oizys.languages = mkOption {
|
options.oizys.languages = mkOption {
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIfIn;
|
inherit (lib) mkIfIn;
|
||||||
cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
|
pixi = pkgs.callPackage ../../pkgs/pixi.nix {};
|
||||||
in {
|
in {
|
||||||
config = mkIfIn "python" cfg {
|
config = mkIfIn "python" cfg {
|
||||||
environment.systemPackages = let
|
environment.systemPackages = let
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIfIn;
|
inherit (lib) mkIf mkIfIn;
|
||||||
cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
in {
|
in {
|
||||||
config = mkIfIn "tex" cfg {
|
config = mkIfIn "tex" cfg {
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
nil
|
|
||||||
alejandra
|
alejandra
|
||||||
|
|
||||||
self.packages.${pkgs.system}.oizys
|
self.packages.${pkgs.system}.oizys
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
{
|
{...}: {
|
||||||
config,
|
virtualisation.virtualbox = {
|
||||||
lib,
|
host.enable = true;
|
||||||
...
|
# guest.enable = true;
|
||||||
}: let
|
|
||||||
inherit (lib) mkEnableOption mkIf;
|
|
||||||
cfg = config.oizys.vbox;
|
|
||||||
in {
|
|
||||||
options.oizys.vbox.enable = mkEnableOption "enable virtualbox host";
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
virtualisation.virtualbox = {
|
|
||||||
host.enable = true;
|
|
||||||
};
|
|
||||||
users.extraGroups.vboxusers.members = ["daylin"];
|
|
||||||
};
|
};
|
||||||
|
users.extraGroups.vboxusers.members = ["daylin"];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +1,23 @@
|
||||||
import std/[macros, os, osproc, parseopt, times, strformat, strutils, terminal]
|
import std/[os, osproc, parseopt, times, strutils, terminal]
|
||||||
from std/nativesockets import getHostname
|
from std/nativesockets import getHostname
|
||||||
|
|
||||||
let summaryFile = getEnv("GITHUB_STEP_SUMMARY")
|
let summaryFile = getEnv("GITHUB_STEP_SUMMARY")
|
||||||
|
|
||||||
macro doc(procedure: typed): untyped =
|
proc info(args: varargs[string, `$`]) =
|
||||||
## extract documenatation comments from procedure
|
|
||||||
procedure.expectKind(nnkSym)
|
|
||||||
if procedure.symKind != nskProc:
|
|
||||||
error("procedure expected", procedure)
|
|
||||||
let
|
|
||||||
impl = procedure.getImpl
|
|
||||||
docs = impl.body.extractDocCommentsAndRunnables
|
|
||||||
var doc: string
|
|
||||||
for element in docs:
|
|
||||||
if element.kind == nnkCommentStmt:
|
|
||||||
doc.addSep("\n", startLen = 1)
|
|
||||||
doc.add($element)
|
|
||||||
result = newLit(doc)
|
|
||||||
|
|
||||||
proc logInfo(args: varargs[string, `$`]) =
|
|
||||||
stdout.styledWriteLine(
|
stdout.styledWriteLine(
|
||||||
fgCyan, "oizys", resetStyle, "|",
|
fgCyan, "oizys", resetStyle, "|",
|
||||||
styleDim, "INFO", resetStyle, "| ",
|
styleDim, "INFO", resetStyle, "| ",
|
||||||
args.join("")
|
args.join("")
|
||||||
)
|
)
|
||||||
|
|
||||||
proc logErr(args: varargs[string, `$`]) =
|
proc error(args: varargs[string, `$`]) =
|
||||||
stdout.styledWriteLine(
|
stdout.styledWriteLine(
|
||||||
fgCyan, "oizys", resetStyle, "|",
|
fgCyan, "oizys", resetStyle, "|",
|
||||||
fgRed, "ERROR", resetStyle, "| ",
|
fgRed, "ERROR", resetStyle, "| ",
|
||||||
args.join("")
|
args.join("")
|
||||||
)
|
)
|
||||||
|
|
||||||
proc logWarn(args: varargs[string, `$`]) =
|
proc warn(args: varargs[string, `$`]) =
|
||||||
stdout.styledWriteLine(
|
stdout.styledWriteLine(
|
||||||
fgCyan, "oizys", resetStyle, "|",
|
fgCyan, "oizys", resetStyle, "|",
|
||||||
fgYellow, "WARN", resetStyle, "| ",
|
fgYellow, "WARN", resetStyle, "| ",
|
||||||
|
@ -49,7 +34,7 @@ type
|
||||||
|
|
||||||
proc execQuit(c: OizysContext, args: varargs[string]) =
|
proc execQuit(c: OizysContext, args: varargs[string]) =
|
||||||
let cmd = (@args & c.extraArgs).join(" ")
|
let cmd = (@args & c.extraArgs).join(" ")
|
||||||
logInfo "exec: ", cmd
|
info "exec: ", cmd
|
||||||
quit (execCmd cmd)
|
quit (execCmd cmd)
|
||||||
|
|
||||||
proc newCtx(): OizysContext =
|
proc newCtx(): OizysContext =
|
||||||
|
@ -59,11 +44,11 @@ proc newCtx(): OizysContext =
|
||||||
|
|
||||||
proc check(c: OizysContext) =
|
proc check(c: OizysContext) =
|
||||||
if not dirExists c.flake:
|
if not dirExists c.flake:
|
||||||
logErr c.flake, "does not exist"
|
error c.flake, " does not exist"
|
||||||
logErr "please use -f/--flake or $FLAKE_PATH"
|
error "please use -f/--flake or $FLAKE_PATH"
|
||||||
quit 1
|
quit 1
|
||||||
logInfo "flake:", c.flake
|
info "flake: ", c.flake
|
||||||
logInfo "host:", c.host
|
info "host: ", c.host
|
||||||
|
|
||||||
proc cmd(c: OizysContext): string {.inline.} =
|
proc cmd(c: OizysContext): string {.inline.} =
|
||||||
let pixExists = findExe("pix") != ""
|
let pixExists = findExe("pix") != ""
|
||||||
|
@ -71,7 +56,7 @@ proc cmd(c: OizysContext): string {.inline.} =
|
||||||
if pixExists:
|
if pixExists:
|
||||||
return "pix"
|
return "pix"
|
||||||
else:
|
else:
|
||||||
logWarn "pinix not found, falling back to nix"
|
warn "pinix not found, falling back to nix"
|
||||||
return "nix"
|
return "nix"
|
||||||
|
|
||||||
proc systemFlakePath(c: OizysContext): string =
|
proc systemFlakePath(c: OizysContext): string =
|
||||||
|
@ -86,7 +71,6 @@ proc dry(c: OizysContext) =
|
||||||
execQuit c, c.cmd, "build", c.systemFlakePath, "--dry-run"
|
execQuit c, c.cmd, "build", c.systemFlakePath, "--dry-run"
|
||||||
|
|
||||||
proc cache(c: OizysContext) =
|
proc cache(c: OizysContext) =
|
||||||
## build and push to cachix
|
|
||||||
let start = now()
|
let start = now()
|
||||||
let code = execCmd """
|
let code = execCmd """
|
||||||
cachix watch-exec """ & c.cache & """ \
|
cachix watch-exec """ & c.cache & """ \
|
||||||
|
@ -95,18 +79,16 @@ proc cache(c: OizysContext) =
|
||||||
--print-build-logs \
|
--print-build-logs \
|
||||||
--accept-flake-config
|
--accept-flake-config
|
||||||
"""
|
"""
|
||||||
|
|
||||||
let duration = (now() - start)
|
let duration = (now() - start)
|
||||||
if code != 0:
|
if code != 0:
|
||||||
logErr "failed to build configuration for: ", c.host
|
error "faile to build configuration for: ", c.host
|
||||||
quit code
|
|
||||||
|
|
||||||
if summaryFile != "":
|
if summaryFile != "":
|
||||||
writeFile(
|
writeFile(
|
||||||
summaryFile,
|
summaryFile,
|
||||||
"Built host: " & c.host & " in " & $duration & " seconds"
|
"Built host: " & c.host & " in " & $duration & " seconds"
|
||||||
)
|
)
|
||||||
logInfo "Built host: " & c.host & " in " & $duration & " seconds"
|
info "Built host: " & c.host & " in " & $duration & " seconds"
|
||||||
|
|
||||||
|
|
||||||
proc nixosRebuild(c: OizysContext, subcmd: string) =
|
proc nixosRebuild(c: OizysContext, subcmd: string) =
|
||||||
|
@ -121,20 +103,15 @@ proc switch(c: OizysContext) =
|
||||||
## nixos rebuild switch
|
## nixos rebuild switch
|
||||||
nixosRebuild c, "switch"
|
nixosRebuild c, "switch"
|
||||||
|
|
||||||
proc path(c: OizysContext) =
|
const usage = """
|
||||||
## print nix flake output
|
|
||||||
echo c.systemFlakePath
|
|
||||||
|
|
||||||
const usage = fmt"""
|
|
||||||
oizys <cmd> [opts]
|
oizys <cmd> [opts]
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
dry {dry.doc}
|
dry poor man's nix flake check
|
||||||
boot {boot.doc}
|
boot nixos-rebuild boot
|
||||||
switch {switch.doc}
|
switch nixos-rebuild switch
|
||||||
cache {cache.doc}
|
cache build and push to cachix
|
||||||
build {build.doc}
|
build build system flake
|
||||||
path {path.doc}
|
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-h|--help show this help
|
-h|--help show this help
|
||||||
|
@ -152,9 +129,8 @@ proc runCmd(c: OizysContext, cmd: string) =
|
||||||
of "boot": boot c
|
of "boot": boot c
|
||||||
of "cache": cache c
|
of "cache": cache c
|
||||||
of "build": build c
|
of "build": build c
|
||||||
of "path": path c
|
|
||||||
else:
|
else:
|
||||||
logErr "unknown command: ", cmd
|
error "unknown command: ", cmd
|
||||||
echo usage
|
echo usage
|
||||||
quit 1
|
quit 1
|
||||||
|
|
||||||
|
@ -183,9 +159,11 @@ when isMainModule:
|
||||||
for kind, key, val in p.getopt():
|
for kind, key, val in p.getopt():
|
||||||
case kind
|
case kind
|
||||||
of cmdArgument:
|
of cmdArgument:
|
||||||
|
echo key
|
||||||
subcmd = key
|
subcmd = key
|
||||||
of cmdLongOption, cmdShortOption:
|
of cmdLongOption, cmdShortOption:
|
||||||
if key == "": break
|
if key == "":
|
||||||
|
break
|
||||||
parseFlag c, kind, key, val
|
parseFlag c, kind, key, val
|
||||||
of cmdEnd:
|
of cmdEnd:
|
||||||
discard
|
discard
|
||||||
|
|
|
@ -10,16 +10,5 @@
|
||||||
(f: f != "default.nix")
|
(f: f != "default.nix")
|
||||||
(builtins.attrNames (builtins.readDir ./.)));
|
(builtins.attrNames (builtins.readDir ./.)));
|
||||||
in {
|
in {
|
||||||
nixpkgs.overlays =
|
nixpkgs.overlays = defaultOverlays;
|
||||||
defaultOverlays
|
|
||||||
++ [
|
|
||||||
(
|
|
||||||
final: _prev: {
|
|
||||||
stable = import inputs.stable {
|
|
||||||
system = final.system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
{...}: (final: prev: {
|
{...}: (final: prev: {
|
||||||
nimble = prev.nimble.overrideNimAttrs {
|
nimble = prev.nimble.overrideNimAttrs {
|
||||||
version = "0.14.2-5e7901760e89108476a4e21976a0ef783403e8fe";
|
version = "0.14.2-f74bf2";
|
||||||
requiredNimVersion = 2;
|
requiredNimVersion = 2;
|
||||||
buildInputs = [prev.pkgs.openssl];
|
buildInputs = [prev.pkgs.openssl];
|
||||||
|
|
||||||
src = final.fetchFromGitHub {
|
src = final.fetchFromGitHub {
|
||||||
owner = "nim-lang";
|
owner = "nim-lang";
|
||||||
repo = "nimble";
|
repo = "nimble";
|
||||||
|
# more recent commit
|
||||||
# most recent commit 2024-03-11
|
rev = "f74bf2bc388f7a0154104b4bcaa093a499d3f0f7";
|
||||||
rev = "5e7901760e89108476a4e21976a0ef783403e8fe";
|
|
||||||
hash = "sha256-8b5yKvEl7c7wA/8cpdaN2CSvawQJzuRce6mULj3z/mI=";
|
hash = "sha256-8b5yKvEl7c7wA/8cpdaN2CSvawQJzuRce6mULj3z/mI=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
76
pkgs/pixi.nix
Normal file
76
pkgs/pixi.nix
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, rustPlatform
|
||||||
|
, fetchFromGitHub
|
||||||
|
, pkg-config
|
||||||
|
, openssl
|
||||||
|
, installShellFiles
|
||||||
|
, darwin
|
||||||
|
, testers
|
||||||
|
, pixi
|
||||||
|
}:
|
||||||
|
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "pixi";
|
||||||
|
version = "0.15.2";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "prefix-dev";
|
||||||
|
repo = "pixi";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-bh8Uu6Q2AND50Qzivc6k1Z8JWudkHC2i4YW1Hxa69SM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoHash = "sha256-yMIcPwnuN7F2ZrOtJw8T+nxeSzLsYn+iC34bYeWpi/w=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkg-config
|
||||||
|
installShellFiles
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
openssl
|
||||||
|
]
|
||||||
|
++ lib.optionals stdenv.isDarwin (
|
||||||
|
with darwin.apple_sdk_11_0.frameworks; [ CoreFoundation IOKit SystemConfiguration Security ]
|
||||||
|
);
|
||||||
|
|
||||||
|
# There are some CI failures with Rattler. Tests on Aarch64 has been skipped.
|
||||||
|
# See https://github.com/prefix-dev/pixi/pull/241.
|
||||||
|
doCheck = !stdenv.isAarch64;
|
||||||
|
|
||||||
|
preCheck = ''
|
||||||
|
export HOME="$(mktemp -d)"
|
||||||
|
'';
|
||||||
|
|
||||||
|
checkFlags = [
|
||||||
|
# Skip tests requiring network
|
||||||
|
"--skip=add_channel"
|
||||||
|
"--skip=add_functionality"
|
||||||
|
"--skip=add_functionality_os"
|
||||||
|
"--skip=add_functionality_union"
|
||||||
|
"--skip=add_pypi_functionality"
|
||||||
|
"--skip=test_alias"
|
||||||
|
"--skip=test_cwd"
|
||||||
|
"--skip=test_incremental_lock_file"
|
||||||
|
];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
installShellCompletion --cmd pix \
|
||||||
|
--bash <($out/bin/pixi completion --shell bash) \
|
||||||
|
--fish <($out/bin/pixi completion --shell fish) \
|
||||||
|
--zsh <($out/bin/pixi completion --shell zsh)
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.tests.version = testers.testVersion {
|
||||||
|
package = pixi;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Package management made easy";
|
||||||
|
homepage = "https://pixi.sh/";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
maintainers = with lib.maintainers; [ aaronjheng edmundmiller ];
|
||||||
|
mainProgram = "pixi";
|
||||||
|
};
|
||||||
|
}
|
3
todo.md
3
todo.md
|
@ -4,7 +4,4 @@
|
||||||
- [ ] trackdown wezterm bug... (try building from flake?)
|
- [ ] trackdown wezterm bug... (try building from flake?)
|
||||||
> https://github.com/wez/wezterm/issues/5067
|
> https://github.com/wez/wezterm/issues/5067
|
||||||
|
|
||||||
- [ ] Check if vivaldi-ffmpeg-codecs are out of date
|
|
||||||
https://forum.vivaldi.net/topic/88884/page-crash-due-to-read-out-of-range-on-nixos/12
|
|
||||||
|
|
||||||
<!-- generated with <3 by daylinmorgan/todo -->
|
<!-- generated with <3 by daylinmorgan/todo -->
|
||||||
|
|
Loading…
Reference in a new issue