Compare commits

...

12 Commits

Author SHA1 Message Date
github-actions[bot] 5b04c0519e flake.lock: Update
Flake lock file updates:

• Updated input 'hyprland':
    'github:hyprwm/Hyprland/c4b660a33930a0e60e853b6796c1fd76914b1719' (2024-04-04)
  → 'github:hyprwm/Hyprland/9f1604e4b0afec40cfa9bc095d6613a7f749b2c1' (2024-04-07)
• Updated input 'hyprland/hyprcursor':
    'github:hyprwm/hyprcursor/d3876f34779cc03ee51e4aafc0d00a4f187c7544' (2024-03-26)
  → 'github:hyprwm/hyprcursor/981b6617822dadc40246a6c70194d02dfc12e4c6' (2024-04-05)
• Updated input 'hyprland/hyprcursor/hyprlang':
    'github:hyprwm/hyprlang/a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2' (2024-03-08)
  → follows 'hyprland/hyprlang'
• Removed input 'hyprland/hyprcursor/hyprlang/nixpkgs'
• Removed input 'hyprland/hyprcursor/hyprlang/systems'
• Updated input 'hyprland/hyprlang':
    'github:hyprwm/hyprlang/b3e430f81f3364c5dd1a3cc9995706a4799eb3fa' (2024-03-24)
  → 'github:hyprwm/hyprlang/c1402612146ba06606ebf64963a02bc1efe11e74' (2024-03-29)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/f480f9d09e4b4cf87ee6151eba068197125714de' (2024-04-04)
  → 'github:nixos/nixpkgs/9e7f26f82acb057498335362905fde6fea4ca50a' (2024-04-06)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/9b77653338f52da4b498abdf4835efb6ff6e453e' (2024-04-04)
  → 'github:nix-community/nixpkgs-wayland/b4c308244d66a3737e3e56f22c9ee69a0fe17665' (2024-04-06)
• Updated input 'stable':
    'github:nixos/nixpkgs/1487bdea619e4a7a53a4590c475deabb5a9d1bfb' (2024-04-03)
  → 'github:nixos/nixpkgs/72da83d9515b43550436891f538ff41d68eecc7f' (2024-04-05)
• Updated input 'zig2nix':
    'github:Cloudef/zig2nix/31122d9accecf7d281229bb9e12dedddef120a1f' (2024-04-04)
  → 'github:Cloudef/zig2nix/ea80980b813d67f52bb6eaa87fc1b9149259943d' (2024-04-06)
2024-04-07 00:40:06 +00:00
Daylin Morgan 360cb79ea1
deadnix + nixfmt 2024-04-05 09:59:46 -05:00
Daylin Morgan 3547ecd3c5
vutlr is dead long live hetzner 2024-04-04 14:06:03 -05:00
Daylin Morgan a403d14110
don't use b.release_mode 2024-04-04 13:31:16 -05:00
Daylin Morgan 3c29db51ed
pr was merged 2024-04-04 13:09:47 -05:00
Daylin Morgan 3bed7b455b
honor --no-pinix flag 2024-04-04 12:55:19 -05:00
Daylin Morgan 2e630e6d6c
flake.lock: Update
Flake lock file updates:

• Updated input 'hyprland':
    'github:hyprwm/Hyprland/fc0a7af7ba5c52f7a70309020f5cb27c19d068e6?narHash=sha256-EJpuvOfX6F1Hm7SynhRFy98m0WL62abz7GAZiPalnVo%3D' (2024-04-02)
  → 'github:hyprwm/Hyprland/c4b660a33930a0e60e853b6796c1fd76914b1719?narHash=sha256-ayxuwrzpow3cRoKtCYj3v7GGrDHTbKVDDUxb8wd1cL8%3D' (2024-04-04)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d?narHash=sha256-9slQ609YqT9bT/MNX9%2B5k5jltL9zgpn36DpFB7TkttM%3D' (2024-03-29)
  → 'github:nixos/nixpkgs/f480f9d09e4b4cf87ee6151eba068197125714de?narHash=sha256-LbbVOliJKTF4Zl2b9salumvdMXuQBr2kuKP5%2BZwbYq4%3D' (2024-04-04)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/8c4df2153c615554b516ba698f5f7bd64f7bf520?narHash=sha256-e3gegueJAWQVrE4SXYh13Uu6tOCjpnagqHiKOQ7B31c%3D' (2024-03-31)
  → 'github:nix-community/nixpkgs-wayland/9b77653338f52da4b498abdf4835efb6ff6e453e?narHash=sha256-NoMBBCADTms3yx5BL%2Bsbc7vfDivNiYULO6t9GBAsPt0%3D' (2024-04-04)
• Updated input 'stable':
    'github:nixos/nixpkgs/219951b495fc2eac67b1456824cc1ec1fd2ee659?narHash=sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg%3D' (2024-03-28)
  → 'github:nixos/nixpkgs/1487bdea619e4a7a53a4590c475deabb5a9d1bfb?narHash=sha256-XP24tOobf6GGElMd0ux90FEBalUtw6NkBSVh/RlA6ik%3D' (2024-04-03)
• Updated input 'zig2nix':
    'github:Cloudef/zig2nix/2b33861efe56118d50bc04a2a9165e9f1f50d350?narHash=sha256-MwPoFX6e87DEs93VFIYe43bpNjXz/90kvwNYjctjfwA%3D' (2024-04-02)
  → 'github:Cloudef/zig2nix/31122d9accecf7d281229bb9e12dedddef120a1f?narHash=sha256-VNFjRCfTYvWP2UvjA9r/44qrTXZ%2BJGOVnYSTDSajdeM%3D' (2024-04-04)
2024-04-04 12:19:24 -05:00
Daylin Morgan 461c7c393a
add catppuccin-gtk rosewater 2024-04-04 12:16:39 -05:00
Daylin Morgan 5c0e1cb3ac
use flake for system zig download 2024-04-04 12:13:49 -05:00
Daylin Morgan 2c278b0501
oizys-zig because I can 2024-04-04 12:06:13 -05:00
Daylin Morgan e46eaa3bf8
add zotero 2024-04-03 14:12:47 -05:00
Daylin Morgan f2d03f976c
flake.lock: Update
Flake lock file updates:

• Updated input 'hyprland':
    'github:hyprwm/Hyprland/9b7ae25ae83b5b0d6f61fe542391301a57d31270?narHash=sha256-YUnZ%2Bqy4ScRIWpb4/ejSv0fHewIGNHnVSLp0FN6elyY%3D' (2024-03-26)
  → 'github:hyprwm/Hyprland/db1506130b507f92e0daf3a36495fb985e242bbc?narHash=sha256-Gv0GD7NqsO6M4WeORRTK%2BLCfNjZD7LGhAZTapoZortw%3D' (2024-04-01)
• Updated input 'hyprland/hyprcursor':
    'github:hyprwm/hyprcursor/6a92473237f430399a417e1c2da9d7fcd4970086?narHash=sha256-5vvhCSUGG9TA2G1eIRgokuYizhRnZu0ZbcU1MXfHsUE%3D' (2024-03-21)
  → 'github:hyprwm/hyprcursor/d3876f34779cc03ee51e4aafc0d00a4f187c7544?narHash=sha256-sArxGyUBiCA1in%2Bq6t0QqT%2BZJiZ1PyBp7cNPKLmREM0%3D' (2024-03-26)
• Updated input 'hyprland/hyprlang':
    'github:hyprwm/hyprlang/a2f39421144d42541c057be235154ce21b76c0f6?narHash=sha256-tt0UgVKWeLQ%2BtFzvqrm4uAZbzONwdGshpfiLHAQ1P2c%3D' (2024-03-20)
  → 'github:hyprwm/hyprlang/b3e430f81f3364c5dd1a3cc9995706a4799eb3fa?narHash=sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo%3D' (2024-03-24)
• Updated input 'nix-index-database':
    'github:nix-community/nix-index-database/34519f3bb678a5abbddf7b200ac5347263ee781b?narHash=sha256-h/NQECj6mIzF4XR6AQoSpkCnwqAM%2Bol4%2BqOdYi2ykmQ%3D' (2024-03-24)
  → 'github:nix-community/nix-index-database/2844b5f3ad3b478468151bd101370b9d8ef8a3a7?narHash=sha256-JPStavwlT7TfxxiXHk6Q7sbNxtnXAIjXQJMLO0KB6M0%3D' (2024-03-31)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/c726225724e681b3626acc941c6f95d2b0602087?narHash=sha256-2xu0jVSjuKhN97dqc4bVtvEH52Rwh6%2BuyI1XCnzoUyI%3D' (2024-03-25)
  → 'github:nixos/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d?narHash=sha256-9slQ609YqT9bT/MNX9%2B5k5jltL9zgpn36DpFB7TkttM%3D' (2024-03-29)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/771508700b2666436887b9404aad9c1ec99a9a1a?narHash=sha256-PK29HGNEu/5m0j8WW1W7yNvd0QumauTtzmPHLR2mnUo%3D' (2024-03-26)
  → 'github:nix-community/nixpkgs-wayland/8c4df2153c615554b516ba698f5f7bd64f7bf520?narHash=sha256-e3gegueJAWQVrE4SXYh13Uu6tOCjpnagqHiKOQ7B31c%3D' (2024-03-31)
• Updated input 'nixpkgs-wayland/lib-aggregate':
    'github:nix-community/lib-aggregate/120535dff702c551ec76a125a181d90131407264?narHash=sha256-s6z371miAZonduv53LQzjthvNCs4R%2BoTbv9cRu%2BiyL8%3D' (2024-03-24)
  → 'github:nix-community/lib-aggregate/9c06929b83e57c18d125f1105ba6a423f24083d2?narHash=sha256-D2WENp9GuaCostvNcQ7vElekk0V5cuMdnFZ7NfRhVrQ%3D' (2024-03-31)
• Updated input 'nixpkgs-wayland/lib-aggregate/nixpkgs-lib':
    'github:nix-community/nixpkgs.lib/b2a1eeef8c185f6bd27432b053ff09d773244cbc?narHash=sha256-knrTvpl81yGFHIpm1SsLDApe0thFkw1cl3ISAMPmP/0%3D' (2024-03-24)
  → 'github:nix-community/nixpkgs.lib/90b1a963ff84dc532db92f678296ff2499a60a87?narHash=sha256-cqfX0QJNEnge3a77VnytM0Q6QZZ0DziFXt6tSCV8ZSc%3D' (2024-03-31)
• Updated input 'stable':
    'github:nixos/nixpkgs/56528ee42526794d413d6f244648aaee4a7b56c0?narHash=sha256-l0zlN/3CiodvWDtfBOVxeTwYSRz93muVbXWSpaMjXxM%3D' (2024-03-22)
  → 'github:nixos/nixpkgs/219951b495fc2eac67b1456824cc1ec1fd2ee659?narHash=sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg%3D' (2024-03-28)
2024-04-01 12:12:26 -05:00
17 changed files with 358 additions and 69 deletions

View File

@ -22,7 +22,7 @@ See below for the currently maintained hosts.
<tr>
<td><img src="https://upload.wikimedia.org/wikipedia/commons/d/df/Runic_letter_algiz.svg"></td>
<td>algiz</td>
<td>Vultr VPS hosting forgejo,soft-serve & gts</td>
<td>Hetzner Cloud hosting forgejo,soft-serve & gts</td>
</tr>
<tr>
<td><img src="https://upload.wikimedia.org/wikipedia/commons/5/57/Runic_letter_mannaz.svg"></td>

View File

@ -39,7 +39,7 @@
},
"flake-utils": {
"inputs": {
"systems": "systems_3"
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
@ -55,9 +55,30 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"hyprcursor": {
"inputs": {
"hyprlang": "hyprlang",
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
@ -68,11 +89,11 @@
]
},
"locked": {
"lastModified": 1711035742,
"narHash": "sha256-5vvhCSUGG9TA2G1eIRgokuYizhRnZu0ZbcU1MXfHsUE=",
"lastModified": 1712339458,
"narHash": "sha256-j8pv3tL2EFLGuvFoO64dHWD8YzNvD77hRb4EEx5ADgE=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "6a92473237f430399a417e1c2da9d7fcd4970086",
"rev": "981b6617822dadc40246a6c70194d02dfc12e4c6",
"type": "github"
},
"original": {
@ -85,20 +106,20 @@
"inputs": {
"hyprcursor": "hyprcursor",
"hyprland-protocols": "hyprland-protocols",
"hyprlang": "hyprlang_2",
"hyprlang": "hyprlang",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2",
"systems": "systems",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1711460334,
"narHash": "sha256-YUnZ+qy4ScRIWpb4/ejSv0fHewIGNHnVSLp0FN6elyY=",
"lastModified": 1712448441,
"narHash": "sha256-dQ+5CYpy/dbpX0hvIFBYF/FDjWal4wAYpTHfUzGoDRg=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "9b7ae25ae83b5b0d6f61fe542391301a57d31270",
"rev": "9f1604e4b0afec40cfa9bc095d6613a7f749b2c1",
"type": "github"
},
"original": {
@ -154,29 +175,6 @@
}
},
"hyprlang": {
"inputs": {
"nixpkgs": [
"hyprland",
"hyprcursor",
"nixpkgs"
],
"systems": "systems"
},
"locked": {
"lastModified": 1709914708,
"narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlang_2": {
"inputs": {
"nixpkgs": [
"hyprland",
@ -188,11 +186,11 @@
]
},
"locked": {
"lastModified": 1710960526,
"narHash": "sha256-tt0UgVKWeLQ+tFzvqrm4uAZbzONwdGshpfiLHAQ1P2c=",
"lastModified": 1711671891,
"narHash": "sha256-C/Wwsy/RLxHP1axFFl+AnwJRWfd8gxDKKoa8nt8Qk3c=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "a2f39421144d42541c057be235154ce21b76c0f6",
"rev": "c1402612146ba06606ebf64963a02bc1efe11e74",
"type": "github"
},
"original": {
@ -207,11 +205,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1711282133,
"narHash": "sha256-s6z371miAZonduv53LQzjthvNCs4R+oTbv9cRu+iyL8=",
"lastModified": 1711886936,
"narHash": "sha256-D2WENp9GuaCostvNcQ7vElekk0V5cuMdnFZ7NfRhVrQ=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "120535dff702c551ec76a125a181d90131407264",
"rev": "9c06929b83e57c18d125f1105ba6a423f24083d2",
"type": "github"
},
"original": {
@ -270,11 +268,11 @@
]
},
"locked": {
"lastModified": 1711249705,
"narHash": "sha256-h/NQECj6mIzF4XR6AQoSpkCnwqAM+ol4+qOdYi2ykmQ=",
"lastModified": 1711854532,
"narHash": "sha256-JPStavwlT7TfxxiXHk6Q7sbNxtnXAIjXQJMLO0KB6M0=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "34519f3bb678a5abbddf7b200ac5347263ee781b",
"rev": "2844b5f3ad3b478468151bd101370b9d8ef8a3a7",
"type": "github"
},
"original": {
@ -285,11 +283,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1711370797,
"narHash": "sha256-2xu0jVSjuKhN97dqc4bVtvEH52Rwh6+uyI1XCnzoUyI=",
"lastModified": 1712420723,
"narHash": "sha256-VnG0Eu394Ga2FCe8Q66m6OEQF8iAqjDYsjmtl+N2omk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c726225724e681b3626acc941c6f95d2b0602087",
"rev": "9e7f26f82acb057498335362905fde6fea4ca50a",
"type": "github"
},
"original": {
@ -301,11 +299,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1711241261,
"narHash": "sha256-knrTvpl81yGFHIpm1SsLDApe0thFkw1cl3ISAMPmP/0=",
"lastModified": 1711846064,
"narHash": "sha256-cqfX0QJNEnge3a77VnytM0Q6QZZ0DziFXt6tSCV8ZSc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "b2a1eeef8c185f6bd27432b053ff09d773244cbc",
"rev": "90b1a963ff84dc532db92f678296ff2499a60a87",
"type": "github"
},
"original": {
@ -324,11 +322,11 @@
]
},
"locked": {
"lastModified": 1711451641,
"narHash": "sha256-PK29HGNEu/5m0j8WW1W7yNvd0QumauTtzmPHLR2mnUo=",
"lastModified": 1712439754,
"narHash": "sha256-2wRTYlTnkk35ChwnULdl3GomhgEO9PYCWxvm3Ozrj0w=",
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"rev": "771508700b2666436887b9404aad9c1ec99a9a1a",
"rev": "b4c308244d66a3737e3e56f22c9ee69a0fe17665",
"type": "github"
},
"original": {
@ -382,16 +380,17 @@
"nixpkgs-wayland": "nixpkgs-wayland",
"pinix": "pinix",
"stable": "stable",
"tsm": "tsm"
"tsm": "tsm",
"zig2nix": "zig2nix"
}
},
"stable": {
"locked": {
"lastModified": 1711124224,
"narHash": "sha256-l0zlN/3CiodvWDtfBOVxeTwYSRz93muVbXWSpaMjXxM=",
"lastModified": 1712310679,
"narHash": "sha256-XgC/a/giEeNkhme/AV1ToipoZ/IVm1MV2ntiK4Tm+pw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "56528ee42526794d413d6f244648aaee4a7b56c0",
"rev": "72da83d9515b43550436891f538ff41d68eecc7f",
"type": "github"
},
"original": {
@ -418,16 +417,16 @@
},
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"repo": "default",
"type": "github"
}
},
@ -541,6 +540,27 @@
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"zig2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1712365704,
"narHash": "sha256-kihexAwySn5d5JItCwLeDgC7+TWpb+unjUJNSgqZ60A=",
"owner": "Cloudef",
"repo": "zig2nix",
"rev": "ea80980b813d67f52bb6eaa87fc1b9149259943d",
"type": "github"
},
"original": {
"owner": "Cloudef",
"repo": "zig2nix",
"type": "github"
}
}
},
"root": "root",

View File

@ -22,6 +22,9 @@
nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
zig2nix.url = "github:Cloudef/zig2nix";
zig2nix.inputs.nixpkgs.follows = "nixpkgs";
};
nixConfig = {

View File

@ -10,7 +10,7 @@ inputs: let
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
supportedSystems = ["x86_64-linux"];
in rec {
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
forAllSystems = f: genAttrs supportedSystems (system: f (import nixpkgs {inherit system;}));
nixosModules = listToAttrs (findModulesList ../modules);
@ -32,9 +32,10 @@ in rec {
oizysHosts = mapAttrs (name: _: mkSystem name) (readDir ../hosts);
oizysPkg = forAllSystems (
pkgs: rec {
oizys-zig = pkgs.callPackage ../pkgs/oizys/oizys-zig {zig2nix = inputs.zig2nix;};
oizys-nim = pkgs.callPackage ../pkgs/oizys/oizys-nim {};
oizys = pkgs.callPackage ../pkgs/oizys/oizys-rs {};
default = oizys;
oizys-rs = pkgs.callPackage ../pkgs/oizys/oizys-rs {};
default = oizys-zig;
}
);
devShells = forAllSystems (

View File

@ -16,8 +16,15 @@ in {
inkscape
gimp
zotero
libreoffice-qt
hunspell # spell check for libreoffice
(catppuccin-gtk.override {
accents = ["rosewater"];
variant = "mocha";
})
];
};
}

View File

@ -1,4 +1,5 @@
{
inputs,
config,
lib,
pkgs,
@ -6,11 +7,14 @@
}: let
inherit (lib) mkIfIn;
cfg = config.oizys.languages;
zig = inputs.zig2nix.outputs.packages.${pkgs.system}.zig.master.bin;
in {
config = mkIfIn "misc" cfg {
environment.systemPackages = with pkgs; [
go
rustup
];
environment.systemPackages = with pkgs;
[
go
rustup
]
++ [zig];
};
}

View File

@ -25,7 +25,7 @@
nil
alejandra
self.packages.${pkgs.system}.oizys
self.packages.${pkgs.system}.default
inputs.pinix.packages.${pkgs.system}.default
];

View File

@ -15,6 +15,7 @@ mkOizysModule config "chrome" {
"oemmndcbldboiebfnladdacbdfmadadm" # pdf viewer
"clngdbkpkpeebahjckkjfobafhncgmne" # stylus
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
"ekhagklcjbdpajgpjgmbionohlpdbjgc" # zotero connector
];
};

View File

@ -1,6 +1,7 @@
{
installShellFiles,
rustPlatform,
nix-output-monitor,
}:
rustPlatform.buildRustPackage {
pname = "oizys";
@ -11,6 +12,7 @@ rustPlatform.buildRustPackage {
};
nativeBuildInputs = [installShellFiles];
buildInputs = [nix-output-monitor];
postInstall = ''
installShellCompletion --cmd oizys \

13
pkgs/oizys/oizys-zig/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
# Created by https://www.toptal.com/developers/gitignore/api/zig
# Edit at https://www.toptal.com/developers/gitignore?templates=zig
### zig ###
# Zig programming language
zig-cache/
zig-out/
build/
build-*/
docgen_tmp/
# End of https://www.toptal.com/developers/gitignore/api/zig

View File

@ -0,0 +1,36 @@
const std = @import("std");
pub fn build(b: *std.Build) void {
// b.release_mode = .safe;
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "oizys",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("yazap", b.dependency("yazap", .{ .target = target }).module("yazap"));
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
// I haven't written any...
// const exe_unit_tests = b.addTest(.{
// .root_source_file = .{ .path = "src/main.zig" },
// .target = target,
// .optimize = optimize,
// });
//
// const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests);
// const test_step = b.step("test", "Run unit tests");
// test_step.dependOn(&run_exe_unit_tests.step);
//
}

View File

@ -0,0 +1,11 @@
.{
.name = "oizys-zig",
.version = "0.0.0",
.dependencies = .{
.yazap = .{
.url = "git+https://github.com/prajwalch/yazap.git#341750ff62e3102da4a7f8233920aebace1fc337",
.hash = "1220fa71798c994044a987cbde6e73af76bfc402117a61971ccf48f4af4b7154e8d3",
},
},
.paths = .{""},
}

View File

@ -0,0 +1,7 @@
{
"1220fa71798c994044a987cbde6e73af76bfc402117a61971ccf48f4af4b7154e8d3": {
"name": "yazap",
"url": "git+https://github.com/prajwalch/yazap.git#341750ff62e3102da4a7f8233920aebace1fc337",
"hash": "sha256-nNhFpay+xk0Ix3GAT1fZ2q/bD9AAx7Xkl4X7QxlzK0M="
}
}

View File

@ -0,0 +1,13 @@
{
pkgs,
zig2nix,
lib,
...
}:
(zig2nix.outputs.zig-env.${pkgs.system} {
zig = zig2nix.outputs.packages.${pkgs.system}.zig.master.bin;
})
.package {
name = "oizys";
src = lib.cleanSource ./.;
}

View File

@ -0,0 +1,35 @@
const Cli = @This();
const std = @import("std");
const yazap = @import("yazap");
const App = yazap.App;
const Arg = yazap.Arg;
const Allocator = std.mem.Allocator;
app: App,
pub fn init(allocator: Allocator) !Cli {
var app = App.init(allocator, "oizys", "nix begat oizys");
const oizys = app.rootCommand();
var cmd_dry = app.createCommand("dry", "poor man's nix flake check");
var cmd_build = app.createCommand("build", "build nixos (w/nix build)");
var cmd_cache = app.createCommand("cache", "build and push to cachix");
var cmd_output = app.createCommand("output", "show system flake output path");
var cmd_boot = app.createCommand("boot", "nixos rebuild boot");
var cmd_switch = app.createCommand("switch", "nixos rebuild switch");
const commands = .{ &cmd_dry, &cmd_build, &cmd_cache, &cmd_output, &cmd_switch, &cmd_boot };
try cmd_cache.addArg(Arg.singleValueOption("name", 'n', "name of cachix cache"));
inline for (commands) |subcmd| {
try subcmd.addArg(Arg.singleValueOption("flake", 'f', "path to flake"));
try subcmd.addArg(Arg.singleValueOption("host", null, "hostname (default: current host)"));
try subcmd.addArg(Arg.booleanOption("no-pinix", null, "don't use pinix"));
try oizys.addSubcommand(subcmd.*);
}
return Cli{ .app = app };
}
pub fn deinit(self: *Cli) void {
self.app.deinit();
}

View File

@ -0,0 +1,114 @@
const Oizys = @This();
const std = @import("std");
const ArgMatches = @import("yazap").ArgMatches;
const Allocator = std.mem.Allocator;
allocator: Allocator,
flake: []const u8,
host: []const u8,
cache_name: []const u8,
output: []const u8,
cmd: OizysCmd,
no_pinix: bool,
debug: bool = false,
pub const OizysCmd = enum {
dry,
@"switch",
boot,
cache,
output,
build,
};
pub fn init(allocator: std.mem.Allocator, matches: *const ArgMatches) !Oizys {
const cmd = matches.subcommand.?.name;
const flags = matches.subcommandMatches(cmd).?;
const host = flags.getSingleValue("host") orelse try Oizys.getDefaultHostName(allocator);
const flake = flags.getSingleValue("flake") orelse try Oizys.getDefaultFlake(allocator);
return Oizys{
.allocator = allocator,
.host = host,
.flake = flake,
.output = try std.fmt.allocPrint(allocator, "{s}#nixosConfigurations.{s}.config.system.build.toplevel", .{ flake, host }),
.cmd = std.meta.stringToEnum(OizysCmd, cmd).?,
.cache_name = flags.getSingleValue("cache") orelse "daylin",
.no_pinix = flags.containsArg("no-pinix"),
};
}
pub fn deinit(self: *Oizys) void {
self.allocator.free(self.flake);
self.allocator.free(self.host);
self.allocator.free(self.output);
}
pub fn nix(self: *Oizys) []const u8 {
return if (self.no_pinix) "nix" else "pix";
}
pub fn nixos_rebuild(self: *Oizys) []const u8 {
return if (self.no_pinix) "nixos-rebuild" else "pixos-rebuild";
}
pub fn getDefaultHostName(allocator: Allocator) ![]const u8 {
var name_buffer: [std.posix.HOST_NAME_MAX]u8 = undefined;
const hostname = try std.posix.gethostname(&name_buffer);
return std.fmt.allocPrint(allocator, "{s}", .{hostname});
}
pub fn getDefaultFlake(allocator: Allocator) ![]const u8 {
return std.process.getEnvVarOwned(allocator, "OIZYS_DIR") catch {
const homedir = try std.process.getEnvVarOwned(allocator, "HOME");
defer allocator.free(homedir);
return try std.fmt.allocPrint(allocator, "{s}/oizys", .{homedir});
};
}
pub fn getOutputPath(self: *Oizys) ![]const u8 {
return std.fmt.allocPrint(self.allocator, "{s}#nixosConfigurations.{s}.config.system.build.toplevel", .{ self.flake, self.host });
}
pub const NixCmd = enum { Nix, NixosRebuild };
pub fn runNixCmd(self: *Oizys, cmd: NixCmd, argv: []const []const u8) !void {
var args = std.ArrayList([]const u8).init(self.allocator);
defer args.deinit();
switch (cmd) {
NixCmd.Nix => try args.append(self.nix()),
NixCmd.NixosRebuild => try args.appendSlice(&.{ "sudo", self.nixos_rebuild() }),
}
try args.appendSlice(argv);
var p = std.ChildProcess.init(args.items, self.allocator);
_ = try p.spawnAndWait();
}
pub fn cache(self: *Oizys) !void {
var p = std.ChildProcess.init(&.{ "cachix", "watch-exec", self.cache_name, "--verbose", "--", "nix", "build", self.flake, "--print-build-logs", "--accept-flake-config" }, self.allocator);
_ = try p.spawnAndWait();
}
pub fn run(self: *Oizys) !void {
switch (self.cmd) {
.@"switch" => {
try self.runNixCmd(NixCmd.NixosRebuild, &.{ "switch", "--flake", self.flake });
},
.boot => {
try self.runNixCmd(NixCmd.NixosRebuild, &.{ "boot", "--flake", self.flake });
},
.dry => {
try self.runNixCmd(NixCmd.Nix, &.{ "build", self.output, "--dry-run" });
},
.build => {
try self.runNixCmd(NixCmd.Nix, &.{ "build", self.output });
},
.output => {
std.debug.print("{s}", .{self.output});
},
.cache => {
try self.cache();
},
}
}

View File

@ -0,0 +1,22 @@
const std = @import("std");
const Oizys = @import("Oizys.zig");
const Cli = @import("Cli.zig");
pub fn main() !void {
// memory management isn't hard :P
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const allocator = arena.allocator();
var cli = try Cli.init(allocator);
const matches = try cli.app.parseProcess();
if (!matches.containsArgs()) {
try cli.app.displayHelp();
return;
}
var oizys = try Oizys.init(allocator, matches);
try oizys.run();
}