Compare commits

...

13 Commits

Author SHA1 Message Date
Hung 1d39c05834 more credentials 2023-02-22 11:05:10 -07:00
Hung 7150eb19c1 misc changes for credentials, updates on py-poetry template 2023-02-21 08:40:14 -08:00
Hung 20d3325ae9 add work gitlab runner deploy key 2023-02-14 11:27:22 -07:00
Hung 7a37c135ee add credentials encrypted with sops 2023-02-14 11:19:44 -07:00
Hung 78b22d31fc add nickel lang 2023-02-14 10:06:39 -07:00
Hung ed84a5a871 clean c_ 2023-02-14 01:56:48 -07:00
Hung bf22c75270 add sops 2023-02-14 01:34:17 -07:00
Hung 267d7f829a add yang syntax highlight 2023-02-13 17:04:48 -07:00
Hung 34982b3079 fix ssh and use yq-go instead of yq 2023-02-12 12:02:27 -07:00
Hung 4283dba315 ssh: +id_ed25519 2023-02-09 21:54:08 -07:00
Hung 27ed93d41e htran work mbp: +slack :D 2023-02-04 14:48:08 -07:00
Hung c6a69029d7 internal stuffs 2023-02-02 01:51:09 -07:00
Hung d74280a44c nvim: gopls 2023-01-25 10:44:16 -08:00
19 changed files with 817 additions and 170 deletions

10
.sops.yaml Normal file
View File

@ -0,0 +1,10 @@
keys:
- &htran-mbp age1jpm9mtxz6n8vncrk6pk7dppj3r7qxfj5hsgvcdulmp3lxvxez94qvxlgay
- &htran age1jw958shpwu7st8sc4z0fufuswmfpxfc9wl3df9g3f3y57m45j92syr0mng
creation_rules:
- path_regex: .*
key_groups:
- age:
- *htran
- *htran-mbp

41
c_.nix
View File

@ -1,6 +1,6 @@
# a small helper that only builds on top of builtins functions # a small helper that only builds on top of builtins functions
{src}@inputs: _: (builtins // (
builtins // (let let
formatSecondsSinceEpoch = t: formatSecondsSinceEpoch = t:
let let
rem = x: y: x - x / y * y; rem = x: y: x - x / y * y;
@ -23,7 +23,8 @@ m = mp + (if mp < 10 then 3 else -9);
y' = y + (if m <= 2 then 1 else 0); y' = y + (if m <= 2 then 1 else 0);
pad = s: if builtins.stringLength s < 2 then "0" + s else s; pad = s: if builtins.stringLength s < 2 then "0" + s else s;
in "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}" in
"${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}"
+ "${pad (toString minutes)}${pad (toString seconds)}"; + "${pad (toString minutes)}${pad (toString seconds)}";
fetchTree = fetchTree =
@ -37,12 +38,16 @@ fetchTree =
, path ? "" , path ? ""
, narHash ? null , narHash ? null
, lastModified ? 0 , lastModified ? 0
, src ? ./.
}@info: }@info:
if info.type == "github" then if info.type == "github" then
{ outPath = {
outPath =
fetchTarball fetchTarball
({ url = "https://api.${info.host or "github.com"}/repos/" ({
+ "${info.owner}/${info.repo}/tarball/${info.rev}"; } url = "https://api.${info.host or "github.com"}/repos/"
+ "${info.owner}/${info.repo}/tarball/${info.rev}";
}
// (if info ? narHash then { sha256 = info.narHash; } else { }) // (if info ? narHash then { sha256 = info.narHash; } else { })
); );
rev = info.rev; rev = info.rev;
@ -52,7 +57,8 @@ if info.type == "github" then
narHash = info.narHash; narHash = info.narHash;
} }
else if info.type == "git" then else if info.type == "git" then
{ outPath = {
outPath =
builtins.fetchGit builtins.fetchGit
({ url = info.url; } ({ url = info.url; }
// (if info ? rev then { inherit (info) rev; } else { }) // (if info ? rev then { inherit (info) rev; } else { })
@ -65,25 +71,28 @@ else if info.type == "git" then
} // (if info ? rev then { } // (if info ? rev then {
rev = info.rev; rev = info.rev;
shortRev = builtins.substring 0 7 info.rev; shortRev = builtins.substring 0 7 info.rev;
} else { } else { })
})
else if info.type == "path" then else if info.type == "path" then
{ outPath = builtins.path { {
path = if builtins.substring 0 1 info.path != "/" outPath = builtins.path {
path =
if builtins.substring 0 1 info.path != "/"
then src + ("/" + info.path) # make this absolute path by prepending ./ then src + ("/" + info.path) # make this absolute path by prepending ./
else info.path; # it's already an absolute path else info.path; # it's already an absolute path
}; };
narHash = info.narHash; narHash = info.narHash;
} }
else if info.type == "tarball" then else if info.type == "tarball" then
{ outPath = {
outPath =
fetchTarball fetchTarball
({ inherit (info) url; } ({ inherit (info) url; }
// (if info ? narHash then { sha256 = info.narHash; } else { }) // (if info ? narHash then { sha256 = info.narHash; } else { })
); );
} }
else if info.type == "gitlab" then else if info.type == "gitlab" then
{ inherit (info) rev narHash lastModified; {
inherit (info) rev narHash lastModified;
outPath = outPath =
fetchTarball fetchTarball
({ url = "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}"; } ({ url = "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}"; }
@ -94,7 +103,9 @@ else if info.type == "gitlab" then
else else
# FIXME: add Mercurial, tarball inputs. # FIXME: add Mercurial, tarball inputs.
throw "flake input has unsupported input type '${info.type}'"; throw "flake input has unsupported input type '${info.type}'";
in { in
{
inherit fetchTree; inherit fetchTree;
}) }
)) nil

69
credentials.yml Normal file
View File

@ -0,0 +1,69 @@
credentials:
- kind:
name_unencrypted: kv
name_unencrypted: Gitea credentials
user_unencrypted: pegasust
password: ENC[AES256_GCM,data:l472gCfek08/Z1cWL0EVtqWYYhE=,iv:TDUX4piGeHSkFSApeaGIPiXPzYAHZWxoMIuQ8G6cunw=,tag:WhCDoCNIUxe5gdxUuuYhZA==,type:str]
- kind:
name_unencrypted: kv
name_unencrypted: Nix SSH password for hungtr
user_unencrypted: hungtr
password: ENC[AES256_GCM,data:cJpfi8l1mx/86R1Oxd8=,iv:AwYBs4/P4ICNo4B6MxIz3HrGB+hdohIRtVflGBSS/P0=,tag:SC6MO5Zn0xwDRH4TGBR2LQ==,type:str]
- kind:
name_unencrypted: ssh
name_unencrypted: egi-htran
pubkey_unencrypted: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPNKyGKsVG/jVXwAmZvH8rLQPdGj8VgITMSN+/nbXTEY htran@Hung-Tran-MBP.local
privkey: ENC[AES256_GCM,data:OrurRGlutN1N1YFQvD1XbiF3thV8qO2y1ufRHi3ut1RVA/lxmqg1kYdWnYE7tOCCCITs20ZpcPFAwAjjAXZH6NaS8FgEJiPDUnJ+hg5v0VC7c4GNc+G3B8+9Taz7mggg70EL/s5QwofpuqJspr4EHrildX6eUeE6s9KwSFnw6KTBgO4r0JqBaicbbObhzxPYIYHjhxRxsbYMX4i8ADPeYryhEtL168dHEGENuz/mbw2I/5Qp3R/SwroNpYlTpq6ukGeobW4+j2KD7ZV9Nvcs/FL6/lPdaUKPxNW/bDeRhAaw9Mw3oDxHdTNisvCHJ53GHChdWcoXSMjYNH+zbgXp9YTeCLBMf9/lLnnEwtSEuD2kexcF+WR7gcbu6mdxJ1k3HBU+Xkrl6shGFuQv3hH8eSmfLhIdy+zcY/jb6tokQklrdKsrusFjuHhAuKfNl5uA93Pc0NxTZ4plxEEdbeyzz54cWwBf0HXR6ztSrjqfUtud3bQY667MNB2LHO91QBoQE7U2gUQ2CmI3VG9KVm2eh7LsXUjLoLzccYfg+kkTrQJnAfs=,iv:+4wsk7mUsIOWNe9IoV0TgrBKIsQdiJyzwVb2+hlPVTc=,tag:B9P2bHPh78JuwusZnAsC5A==,type:str]
agepub_unencrypted: age1jpm9mtxz6n8vncrk6pk7dppj3r7qxfj5hsgvcdulmp3lxvxez94qvxlgay
agepriv: ENC[AES256_GCM,data:tE6WLw8/dHsC6rfJpek7czvySW0+S2luc470l9X6UFX+zCOwlwoQpTWpIGPIqmkOFNSaaA0cyZ4BmWnlVz1iWxizh8DYqcE5los=,iv:4jnpibK+0cE1isWu6Zl1CsajMWN9Zgw8LGX5WpkRyy8=,tag:vdi85c3Q29olLGsCwrvmcA==,type:str]
- kind:
name_unencrypted: ssh
name_unencrypted: dev1-ssh
pubkey_unencrypted: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH1IiP+d2S152uiD2JjUJfADFv7AS0l3LX2NRgfMTYLe htran@htrandevbox
privkey: ENC[AES256_GCM,data:5lf+Oy0VhsxDLANpBFxtguD5unsZK9yKW/boTlxAOIzlcD1Xf4Nr0iC6YW/4nBB/eJ8xPlUiU5vhRQSLZPqnfc6nQJReqPPafzfugYb3slYBl59EeimBCqTi0qVIUHNFvRpp2agZW0wIQv4hlB3ks+WBVjKixLOdbUBQREZB22DWk6eoKawmekCr7ItDsxGWG7DtHx9A511LyPrT1n/VhAYHTuq6ycbWjDya++bJ/AkYlcqW0jEyQ/Mudo/TYkRt4TpWWDjGPDYVNrjBiwYOSpoM6IwzfRQvimCZnfqyXHrT2gzv9Vqqu9C2Vp2R0FLzbdA8dYoiXwss7opzsI5um6D4AdQv8c16TiVLFF0q0VP2xyRf3j7iqmuwQHIRlkBh2BhnsXT/s35K6cb1dUhIw0aQpFGzL/VuqMKrQW3j3S9pSiiupBuSwdLJ9s8+rkGYTO0Iw+T646L1NFW7oFMP8Fe5ZMC9UuTV/srWNtXHAQaY+L9TwMIQY36P4V0lqaVfCWAiIrBTgLhHQetnzb/Y44Ll/qTdRXHSW6D4,iv:30sivScr8WmFmZx8M/sqTEuGRg72VzJ+bc6AW847xz8=,tag:dJsH+/dhRWQoKwsGAUzqAQ==,type:str]
- kind:
name_unencrypted: age
agepub_unencrypted: age1jw958shpwu7st8sc4z0fufuswmfpxfc9wl3df9g3f3y57m45j92syr0mng
agepriv: ENC[AES256_GCM,data:f66nwYr1WLTejGI2SpHNrf8BYRJJuxpufYLSYVix1uLdBj2TfVJVjN3bLsnHrB1DoeVyaF0nUxrdcL64LhbI38zZC/fNORfXx4E=,iv:J/noycrJlL2+r1ojmUYC/6GUVMGqRFM2ondBm2C7fSE=,tag:pT5z5NQQdS30bucdbPPBng==,type:str]
- kind:
name_unencrypted: ssh
name_unencrypted: gl-egi-htran-ed25519
privkey: ENC[AES256_GCM,data:vM5G2o/syq9YUwqpUONJk5ebwha+UQI0wUCkwkmZTTtx+nB/HTnc4kqxX/eeF9ybSE8vq7YIWuKB8aSjpizOYZjjWIV3qpWBiDmdrWkWfUIl7kDdy75azZjHNRXuXUUExbPYGVjmL7KdDMHY2u1WceDSdEvgB2sNOPw4dNiZ9lcbJ5iDpQzmxaF6zdvZ/rVoXYM2NgSMdM4oTdRtYivcOPuxwRGi39R5XgyPJYwltawSAPFPmNYofszUzYLnD7jPEJqyEQORpcI2oM2qAPab22kDrDLyd51X1F6XT/5chKuPSsidZAVjB6+v2s/yN0quqz3qcP2RTYtaZcFyeEquk6eWA/MWVwCJK8XopNoPVVo0PRppOtq3M9Fss3Z587nQAis8doCbvv9XdUunOFHFWon7k8fGu9cDDMmSOE3KGWCO7Vw0V6dYnBT+OVJnJAxlf7AsUZdXVBo3PK9Zw6+d2XF2N9Jhr0bqA1tpmGqwCygHy41FGbWtuhZBX8JimTPFE1MyT5YvptzwbayONcvps8hZED8zwKbR/64DSF7wn1DAaW0=,iv:JjO6O+FB+W1Gi216bjkVXiIFvxLmIZ4rKLCXcepOIQc=,tag:TxiwbrCZ4vFgw6WMmKrVOg==,type:str]
pubkey_unencrypted: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINOqM08nqvcFhcF6E//dlphXctfck83N0tjKIfil8npY htran@Hung-Tran-MBP.local
agepriv: ENC[AES256_GCM,data:Z4qRvam25nvkNr4DuZhhKtN83NIfNcBW5Wq7SGm0Nb31kAjCS25VfkTrXUtrxWIunMCZEYoIdDLiENjRQPAh/NwffGbZn94/ZKY=,iv:t3YtQvRQPdbDcXgEC/A13W1K9/IIlt6rPceR1lAl0BM=,tag:QmiriOk19fGSPOWj98doUQ==,type:str]
agepub_unencrypted: age1jz7ajxer3fs02uygr8a374jfk7vuklpnnyugrlq4equ285t7nyfqwqdreq
- kind:
name_unencrypted: win-rdp
name_unencrypted: EGNGoat
ip: ENC[AES256_GCM,data:9/FPJM8l4hLvzDc5pg==,iv:ny1LKtgznhzMd3Bhogwu6b6bOk3/uCNarKTmlWRZAes=,tag:PsleUu2ZE4leEMEcEuJdLQ==,type:str]
user_unencrypted: EGN NOC
password: ENC[AES256_GCM,data:YOL5Sw6zaA==,iv:Cs8gySfGIQUBPivkM5N6kflZsRhp2w9xmPwtl7RrEZE=,tag:LXYKdsX++IP+jQyjL6JBrg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1jw958shpwu7st8sc4z0fufuswmfpxfc9wl3df9g3f3y57m45j92syr0mng
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBKNlFvNTh6WGFVaVBvcGlt
aldQWWtqeWpWWlVTTmRPazJmdjlUT2ZZS2pFCmI2eTRPUDVrTWQ5MFR4Rm9lb0Z3
VHBCTFBQSkJmbUpPQ21aZWp6dTJXTVEKLS0tIDlpdDJsNGVCSU85ZEMya3RPL09C
b3hXdnNjdmhjRisvV00wbU1TQml6Sk0KJ1NconEwYIvYlrQTd6yLU1uGEAJBPPTp
z1wkrjS21PjEzZnOx8UmJX5X+kfPTSItgMkWexRdW0/zVDzGRs5AoQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age1jpm9mtxz6n8vncrk6pk7dppj3r7qxfj5hsgvcdulmp3lxvxez94qvxlgay
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCTVNMVm91ZmtzUFVOZm96
Rm5zQUxGbzlNYXpFbnVlUStUeG05bW9rclI4ClNwZ3htUXFsZlBqNHMvV1NMT3JW
WnlxNGFyclVIV3oyWFNPN3BvRFZ5TzgKLS0tIE1PLzNsYngwMFpFaXdrcll2S0F3
Q0ZxRXNvTGlJVHNiZFNyMU5XaTM0YTQKUJvYfdyGqPFmONa+8jKjVb9tbke/HsL2
X33WHFVrQf2uOMRf3yAzRm5SfpdULFQ+JTP3CEUmcZ2nUxTmUs+X6A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-02-22T18:03:37Z"
mac: ENC[AES256_GCM,data:sWw2fm1EuZQD8251fSmqses1qh4KjtCwRJuMqCMjfTMq1HoH54L9Be8Ij83ea9kN/6G12I01D/ISxj4ZFBbrtRazac4snngRcic0ZlHGSS0MrR5FXCJR0EzdLPIMmxhE2352im+iDhArQRF/GglT/n9olpZwWgEvCDFkYrd9kmk=,iv:6oA9CONYbeNF+kVT5gC4ksfOK1ypSsvTswTOoPbFeQE=,tag:GuCdmvk3bHAWjzXqtgX8tQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.3

View File

@ -3,7 +3,7 @@
( (
let let
lock = builtins.fromJSON (builtins.readFile ./flake.lock); lock = builtins.fromJSON (builtins.readFile ./flake.lock);
c_ = import ./c_.nix {src = ./.;}; c_ = import ./c_.nix;
in in
c_.fetchTree lock.nodes.flake-compat.locked c_.fetchTree lock.nodes.flake-compat.locked
) )

View File

@ -16,6 +16,7 @@
# TODO: decompose hm-switch.sh with a base version (where HOME_MANAGER_BIN is injected) # TODO: decompose hm-switch.sh with a base version (where HOME_MANAGER_BIN is injected)
# (lib.shellAsDrv {script = builtins.readFile ./scripts/hm-switch.sh; pname = "hm-switch";}) # (lib.shellAsDrv {script = builtins.readFile ./scripts/hm-switch.sh; pname = "hm-switch";})
pkgs.rust4cargo pkgs.rust4cargo
pkgs.sops
]; ];
# env vars # env vars

View File

@ -2,16 +2,17 @@
"nodes": { "nodes": {
"agenix": { "agenix": {
"inputs": { "inputs": {
"darwin": "darwin",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1673301561, "lastModified": 1676153903,
"narHash": "sha256-gRUWHbBAtMuPDJQXotoI8u6+3DGBIUZHkyQWpIv7WpM=", "narHash": "sha256-uetRyjgMiZCs6srmZ10M764Vn7F53M9mVuqnzHmyBqU=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "42d371d861a227149dc9a7e03350c9ab8b8ddd68", "rev": "ea17cc71b4e1bc5b2601f210a1c85db9453ad723",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,6 +21,52 @@
"type": "github" "type": "github"
} }
}, },
"crane": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nickel",
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1673405853,
"narHash": "sha256-6Nq9DuOo+gE2I8z5UZaKuumykz2xxZ9JGYmUthOuwSA=",
"owner": "ipetkov",
"repo": "crane",
"rev": "b13963c8c18026aa694acd98d14f66d24666f70b",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1673295039,
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -34,6 +81,22 @@
} }
}, },
"flake-compat_2": { "flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1668681692, "lastModified": 1668681692,
@ -49,13 +112,29 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1676283394,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -80,6 +159,36 @@
} }
}, },
"flake-utils_3": { "flake-utils_3": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
@ -94,7 +203,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": { "flake-utils_6": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
@ -109,6 +218,28 @@
"type": "github" "type": "github"
} }
}, },
"gitignore": {
"inputs": {
"nixpkgs": [
"nickel",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -117,11 +248,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1673948101, "lastModified": 1675935446,
"narHash": "sha256-cD0OzFfnLFeeaz4jVszH9QiMTn+PBxmcYzrp+xujpwM=", "narHash": "sha256-WajulTn7QdwC7QuXRBavrANuIXE5z+08EdxdRw1qsNs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "bd3efacb82c721edad1ce9eda583df5fb62ab00a", "rev": "2dce7f1a55e785a22d61668516df62899278c9e4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -156,11 +287,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1673937267, "lastModified": 1676361142,
"narHash": "sha256-zixnItZtMZRKK0bEh8UOBeh8JT4jeMzPR2TtacfXmyE=", "narHash": "sha256-+nyWJcNRTOPCVqYC7tql7gLzPsNvZFa/wB20X9W9vTg=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "2093e574c6c934a718f96d0a173aa965d3958a8b", "rev": "53968082675cd3b8d1809e53a47c0311b7347ef9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -177,11 +308,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1673943288, "lastModified": 1676362549,
"narHash": "sha256-TDo9wDfZH+MJ/tTeCtZ67jdHqtVvIxetLpFN9+vqZ7g=", "narHash": "sha256-FZJb4ty3bdzfsd5dUaW3wR9FN2t1vNJ1IRJJhxErYYA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "3c0bb335936754a2683a84ddf081594ddb567a89", "rev": "447052579b7154c5cc61faf9ed6f3f484b9d053f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -190,6 +321,28 @@
"type": "github" "type": "github"
} }
}, },
"nickel": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_2",
"pre-commit-hooks": "pre-commit-hooks",
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1676039663,
"narHash": "sha256-fkIg8rJcnvT0kEdd4lqwp90rAe5RsxSOrWsmlXzD3Uo=",
"owner": "tweag",
"repo": "nickel",
"rev": "38ca87438918b84ebe7287a040729e4afd8c75b1",
"type": "github"
},
"original": {
"owner": "tweag",
"repo": "nickel",
"type": "github"
}
},
"nix-index-database": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -197,11 +350,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1673752441, "lastModified": 1676172252,
"narHash": "sha256-/g4ImZWV05CrXRWTSJsda6ztIp7LAPxs2L6RCrbQ66U=", "narHash": "sha256-Q5yJPpgbvOTgB0NQTJmlx3di1Sj5QQhSrjv38u6MzsQ=",
"owner": "mic92", "owner": "mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "391180f77505c1c8cdd45fe1a59dc89d3e40300a", "rev": "89e3b689e0ae9bac4c6cdc24d1085d81baeebde4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -212,8 +365,8 @@
}, },
"nixgl": { "nixgl": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1, "lastModified": 1,
@ -228,11 +381,11 @@
}, },
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1673743903, "lastModified": 1676163193,
"narHash": "sha256-sloY6KYyVOozJ1CkbgJPpZ99TKIjIvM+04V48C04sMQ=", "narHash": "sha256-6cTwPLtRHsRrIlKnEg3gQ9L+MYdx87eHdRqlTUi4H8Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "7555e2dfcbac1533f047021f1744ac8871150f9f", "rev": "d3e61f845dbbb77f10900603993c6f00bdfa9fd4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -257,7 +410,38 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1673800717,
"narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1674211260,
"narHash": "sha256-xU6Rv9sgnwaWK7tgCPadV6HhI2Y/fl4lKxJoG2+m9qs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5ed481943351e9fd354aeb557679624224de38d5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1660551188, "lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
@ -272,13 +456,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1673631141, "lastModified": 1676300157,
"narHash": "sha256-AprpYQ5JvLS4wQG/ghm2UriZ9QZXvAwh1HlgA/6ZEVQ=", "narHash": "sha256-1HjRzfp6LOLfcj/HJHdVKWAkX9QRAouoh6AjzJiIerU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "befc83905c965adfd33e5cae49acb0351f6e0404", "rev": "545c7a31e5dedea4a6d372712a18e00ce097d462",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -287,7 +471,7 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1665296151, "lastModified": 1665296151,
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=", "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
@ -303,6 +487,34 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": [
"nickel",
"flake-utils"
],
"gitignore": "gitignore",
"nixpkgs": [
"nickel",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1674122161,
"narHash": "sha256-9QM4rvgUSEwO8DWtJN9sR/afEqrH1s3b6ACsZT5wiAM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "53e766957b73298fa68b47478c48cbcc005cc18a",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
@ -311,24 +523,77 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"kpcli-py": "kpcli-py", "kpcli-py": "kpcli-py",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nickel": "nickel",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixlib": "nixlib", "nixlib": "nixlib",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay_3"
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": [
"nixpkgs": "nixpkgs_4" "nickel",
"crane",
"flake-utils"
],
"nixpkgs": [
"nickel",
"crane",
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1673922364, "lastModified": 1672712534,
"narHash": "sha256-U0XIY/Y/x4fFtlCZKMtWlqOYUnLiXj4F42GQHxWuPow=", "narHash": "sha256-8S0DdMPcbITnlOu0uA81mTo3hgX84wK8S9wS34HEFY4=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "4e0f9b8a5102387f8d19901bced16a256a6ccdc7", "rev": "69fb7bf0a8c40e6c4c197fa1816773774c8ac59f",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"flake-utils": [
"nickel",
"flake-utils"
],
"nixpkgs": [
"nickel",
"nixpkgs"
]
},
"locked": {
"lastModified": 1674267882,
"narHash": "sha256-53sIczqxA5BbrhgO6l54DSisDqHvQ3UUwbSqBryA/k0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "1fd6d280c132f4facad8cd023543fb10121e6487",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_3": {
"inputs": {
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1676341851,
"narHash": "sha256-T8cmSiriXdpZfqlserNyJ1solTCR0DbD8A75epSDOVY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "956ddb5047f98ea08b792b22004b94a9971932c4",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -38,6 +38,7 @@
url = "github:mic92/nix-index-database"; url = "github:mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nickel.url = "github:tweag/nickel";
}; };
outputs = outputs =
@ -51,6 +52,7 @@
, neovim-nightly-overlay , neovim-nightly-overlay
, nix-index-database , nix-index-database
, nixlib , nixlib
, nickel
, ... , ...
}@_inputs: }@_inputs:
let let
@ -58,6 +60,7 @@
# this function should take simple exports of homeConfigurations.${profile}, # this function should take simple exports of homeConfigurations.${profile},
# nixosConfigurations.${profile}, devShells.${profile}, packages.${profile} # nixosConfigurations.${profile}, devShells.${profile}, packages.${profile}
# and correctly produce # and correctly produce
supported_systems = flake-utils.lib.defaultSystems;
cross_platform = config_fn: let cross_platform = config_fn: let
# nixosConfigurations.${profile} -> nixosConfigurations.${system}.${profile} # nixosConfigurations.${profile} -> nixosConfigurations.${system}.${profile}
# pass in: path.to.exports.nixosConfigurations # pass in: path.to.exports.nixosConfigurations
@ -91,7 +94,7 @@
(acc: confName: (strategyMap."${confName}" confName config."${confName}" system)) (acc: confName: (strategyMap."${confName}" confName config."${confName}" system))
{} (builtins.attrNames config)); {} (builtins.attrNames config));
in builtins.foldl' nixlib.lib.recursiveUpdate {} ( in builtins.foldl' nixlib.lib.recursiveUpdate {} (
builtins.map (system: (mapConfig (config_fn system) system)) flake-utils.lib.defaultSystems builtins.map (system: (mapConfig (config_fn system) system)) supported_systems
); );
in cross_platform (system: in cross_platform (system:
let let
@ -173,6 +176,6 @@
debug = { debug = {
inherit final_inputs hosts users modules lib inputs_w_lib unit_tests pkgs nixpkgs nixlib; inherit final_inputs hosts users modules lib inputs_w_lib unit_tests pkgs nixpkgs nixlib;
}; };
formatter."${system}" = pkgs.nixpkgs-fmt; # formatter."${system}" = pkgs.nixpkgs-fmt;
}); });
} }

View File

@ -58,6 +58,7 @@ Plug('hrsh7th/cmp-cmdline')
Plug('hrsh7th/nvim-cmp') Plug('hrsh7th/nvim-cmp')
Plug('onsails/lspkind-nvim') Plug('onsails/lspkind-nvim')
Plug('yioneko/nvim-yati', { tag = '*' }) -- copium: fix Python indent auto-correct from smart-indent Plug('yioneko/nvim-yati', { tag = '*' }) -- copium: fix Python indent auto-correct from smart-indent
Plug('nathanalderson/yang.vim')
-- Plug('tzachar/cmp-tabnine', { ['do'] = './install.sh' }) -- Plug('tzachar/cmp-tabnine', { ['do'] = './install.sh' })
-- DevExp -- DevExp
@ -365,7 +366,7 @@ require('nvim-treesitter.configs').setup {
ensure_installed = { ensure_installed = {
'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css', 'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css',
'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro", 'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro",
"clojure", "fennel", "bash", "nix", "query", "clojure", "fennel", "bash", "nix", "query", "nickel"
}, },
sync_install = false, sync_install = false,
highlight = { highlight = {
@ -608,7 +609,7 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
local servers = { local servers = {
'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua', 'cmake', 'tailwindcss', 'prismals', 'clangd', 'rust_analyzer', 'pyright', 'tsserver', 'sumneko_lua', 'cmake', 'tailwindcss', 'prismals',
'rnix', 'eslint', 'terraformls', 'tflint', 'svelte', 'astro', 'clojure_lsp', "bashls", 'yamlls', "ansiblels", 'rnix', 'eslint', 'terraformls', 'tflint', 'svelte', 'astro', 'clojure_lsp', "bashls", 'yamlls', "ansiblels",
"jsonls", "denols" "jsonls", "denols", "gopls", "nickel_ls"
} }
require("mason").setup({ require("mason").setup({
ui = { ui = {

View File

@ -1,5 +1,6 @@
Host * Host *
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ed25519
# felia mirror on windows # felia mirror on windows
Host felia-win Host felia-win
@ -52,3 +53,41 @@ Host noami
User htran User htran
Port 22 Port 22
Host sr1
HostName 10.30.76.46
User htran
Port 22
HostKeyAlgorithms=+ssh-dss,ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
Host d1-30
HostName 10.111.103.60
User htran
Port 22
Host dev0
HostName 10.100.200.230
User root
Port 22
Host dev1
HostName 10.100.200.220
User htran
Port 22
Host ztp-egi
HostName 10.23.27.201
User root
Port 22
Host d3l-3
HostName 10.111.103.65
User htran
Port 22
Host goat
HostName 10.133.32.100
User "EGN NOC"
Port 22

View File

@ -6,23 +6,6 @@
# might be different from `home-manager`'s # might be different from `home-manager`'s
{ pkgs, lib, config, proj_root, ... }: { pkgs, lib, config, proj_root, ... }:
let let
# NOTE: Failure 1: buildInputs is pretty much ignored
# my_neovim = pkgs.neovim-unwrapped.overrideDerivation (old: {
# # TODO: is there a more beautiful way to override propagatedBuildInputs?
# name = "hungtr-" + old.name;
# buildInputs = (old.buildInputs or []) ++ [
# pkgs.tree-sitter # highlighting
# rust_pkgs # for potentially rust-analyzer
# pkgs.fzf
# pkgs.ripgrep
# pkgs.zk
# pkgs.fd
# ];
# NOTE: Failure 2: propagatedBuildInputs probably only concerns dyn libs
# });
# NOTE: Failure 3: must be unwrapped neovim because home-manager does the wrapping
# my_neovim = pkgs.neovim;
# NOTE: Add packages to nvim_pkgs instead, so that it's available at userspace # NOTE: Add packages to nvim_pkgs instead, so that it's available at userspace
# and is added to the path after wrapping. # and is added to the path after wrapping.
# check: nix repl `homeConfigurations.hungtr.config.programs.neovim.finalPackage.buildCommand` # check: nix repl `homeConfigurations.hungtr.config.programs.neovim.finalPackage.buildCommand`
@ -47,6 +30,10 @@ let
pkgs.stdenv.cc.cc.lib pkgs.stdenv.cc.cc.lib
pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo
pkgs.rust4cargo pkgs.rust4cargo
pkgs.nickel
pkgs.lsp-nls
pkgs.go
# Language-specific stuffs # Language-specific stuffs
@ -56,8 +43,8 @@ let
pkgs.python3Packages.pylint pkgs.python3Packages.pylint
pkgs.python3Packages.flake8 pkgs.python3Packages.flake8
# pkgs.ansible-lint # pkgs.ansible-lint
pkgs.python38Packages.ansible # pkgs.python38Packages.ansible
pkgs.ansible-language-server # pkgs.ansible-language-server
# TODO: the devShell should provide rust-analyzer so that # TODO: the devShell should provide rust-analyzer so that
# cargo test builds binaries compatible with rust-analyzer # cargo test builds binaries compatible with rust-analyzer

View File

@ -14,7 +14,7 @@ in
''; '';
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf (cfg.enable) {
# home.packages = [pkgs.ungoogled-chromium]; # home.packages = [pkgs.ungoogled-chromium];
programs.chromium = { programs.chromium = {
enable = true; enable = true;

View File

@ -89,6 +89,7 @@ in
"gitignore" # `gi list` -> `gi java >>.gitignore` "gitignore" # `gi list` -> `gi java >>.gitignore`
"ripgrep" # adds completion for `rg` "ripgrep" # adds completion for `rg`
"rust" # compe for rustc/cargo "rust" # compe for rustc/cargo
"poetry" # compe for poetry - Python's cargo
# "vi-mode" # edit promps with vi motions :) # "vi-mode" # edit promps with vi motions :)
]; ];
}; };

View File

@ -3,7 +3,7 @@
( (
let let
lock = builtins.fromJSON (builtins.readFile ./flake.lock); lock = builtins.fromJSON (builtins.readFile ./flake.lock);
c_ = import ./../../c_.nix {src = ./.;}; c_ = import ./../../c_.nix;
in in
c_.fetchTree lock.nodes.flake-compat.locked c_.fetchTree lock.nodes.flake-compat.locked
) )

View File

@ -1,5 +1,29 @@
{ {
"nodes": { "nodes": {
"crane": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nickel",
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1673405853,
"narHash": "sha256-6Nq9DuOo+gE2I8z5UZaKuumykz2xxZ9JGYmUthOuwSA=",
"owner": "ipetkov",
"repo": "crane",
"rev": "b13963c8c18026aa694acd98d14f66d24666f70b",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -29,6 +53,38 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1667395993,
@ -60,6 +116,36 @@
} }
}, },
"flake-utils_3": { "flake-utils_3": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
@ -74,7 +160,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": { "flake-utils_6": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
@ -89,6 +175,28 @@
"type": "github" "type": "github"
} }
}, },
"gitignore": {
"inputs": {
"nixpkgs": [
"nickel",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -170,6 +278,28 @@
"type": "github" "type": "github"
} }
}, },
"nickel": {
"inputs": {
"crane": "crane",
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_2",
"pre-commit-hooks": "pre-commit-hooks",
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1676039663,
"narHash": "sha256-fkIg8rJcnvT0kEdd4lqwp90rAe5RsxSOrWsmlXzD3Uo=",
"owner": "tweag",
"repo": "nickel",
"rev": "38ca87438918b84ebe7287a040729e4afd8c75b1",
"type": "github"
},
"original": {
"owner": "tweag",
"repo": "nickel",
"type": "github"
}
},
"nix-index-database": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -192,8 +322,8 @@
}, },
"nixgl": { "nixgl": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1, "lastModified": 1,
@ -222,7 +352,38 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1673800717,
"narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1674211260,
"narHash": "sha256-xU6Rv9sgnwaWK7tgCPadV6HhI2Y/fl4lKxJoG2+m9qs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5ed481943351e9fd354aeb557679624224de38d5",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1660551188, "lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
@ -237,7 +398,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1673796341, "lastModified": 1673796341,
"narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=", "narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=",
@ -253,7 +414,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1665296151, "lastModified": 1665296151,
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=", "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
@ -269,6 +430,34 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": [
"nickel",
"flake-utils"
],
"gitignore": "gitignore",
"nixpkgs": [
"nickel",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1674122161,
"narHash": "sha256-9QM4rvgUSEwO8DWtJN9sR/afEqrH1s3b6ACsZT5wiAM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "53e766957b73298fa68b47478c48cbcc005cc18a",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -276,16 +465,69 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"kpcli-py": "kpcli-py", "kpcli-py": "kpcli-py",
"neovim-nightly-overlay": "neovim-nightly-overlay", "neovim-nightly-overlay": "neovim-nightly-overlay",
"nickel": "nickel",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay_3"
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": [
"nixpkgs": "nixpkgs_4" "nickel",
"crane",
"flake-utils"
],
"nixpkgs": [
"nickel",
"crane",
"nixpkgs"
]
},
"locked": {
"lastModified": 1672712534,
"narHash": "sha256-8S0DdMPcbITnlOu0uA81mTo3hgX84wK8S9wS34HEFY4=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "69fb7bf0a8c40e6c4c197fa1816773774c8ac59f",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"flake-utils": [
"nickel",
"flake-utils"
],
"nixpkgs": [
"nickel",
"nixpkgs"
]
},
"locked": {
"lastModified": 1674267882,
"narHash": "sha256-53sIczqxA5BbrhgO6l54DSisDqHvQ3UUwbSqBryA/k0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "1fd6d280c132f4facad8cd023543fb10121e6487",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_3": {
"inputs": {
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1673922364, "lastModified": 1673922364,

View File

@ -39,6 +39,7 @@
url = "github:mic92/nix-index-database"; url = "github:mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nickel.url = "github:tweag/nickel";
}; };
outputs = outputs =
@ -49,6 +50,7 @@
, flake-utils , flake-utils
, kpcli-py , kpcli-py
, neovim-nightly-overlay , neovim-nightly-overlay
, nickel
, ... , ...
}: }:
let let
@ -171,6 +173,10 @@
inherit pkgs; inherit pkgs;
modules = base.modules ++ [ modules = base.modules ++ [
./home.nix ./home.nix
./base/productive_desktop.nix
{
base.private_chromium.enable = false;
}
{ {
base.graphics.enable = false; base.graphics.enable = false;
# don't want to deal with GL stuffs on mac yet :/ # don't want to deal with GL stuffs on mac yet :/

View File

@ -33,7 +33,7 @@ in
pkgs.zip # compression pkgs.zip # compression
# cool utilities # cool utilities
pkgs.yq # Yaml adaptor for jq (only pretty print, little query) pkgs.yq-go # Yaml adaptor for jq (only pretty print, little query)
# pkgs.xorg.xclock # TODO: only include if have gui # For testing GL installation # pkgs.xorg.xclock # TODO: only include if have gui # For testing GL installation
# pkgs.logseq # TODO: only include if have GL # Obsidian alt # pkgs.logseq # TODO: only include if have GL # Obsidian alt
pkgs.mosh # Parsec for SSH pkgs.mosh # Parsec for SSH

View File

@ -3,6 +3,7 @@ flake_input@{ kpcli-py
, rust-overlay , rust-overlay
, neovim-nightly-overlay , neovim-nightly-overlay
, system , system
, nickel
, ... , ...
}: let }: let
kpcli-py = (final: prev: { kpcli-py = (final: prev: {
@ -36,11 +37,17 @@ flake_input@{ kpcli-py
rust4cargo = nightlyRustWithExts [ ]; rust4cargo = nightlyRustWithExts [ ];
rust4normi = nightlyRustWithExts rust-default-components; rust4normi = nightlyRustWithExts rust-default-components;
}); });
nickel = (final: prev: {
inherit (flake_input.nickel.packages.${system})
lsp-nls nickel nickelWasm;
});
in [ in [
nixgl.overlays.default nixgl.overlays.default
rust-overlay.overlays.default rust-overlay.overlays.default
neovim-nightly-overlay.overlay neovim-nightly-overlay.overlay
rust rust
kpcli-py kpcli-py
nickel
] ]

View File

@ -5,7 +5,7 @@
( (
let let
lock = builtins.fromJSON (builtins.readFile ./flake.lock); lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in (import ./c_.nix {src = ./.;}).fetchTree lock.nodes.flake-compat.locked in (import ./c_.nix).fetchTree lock.nodes.flake-compat.locked
) )
{ src = ./.; } { src = ./.; }
).shellNix ).shellNix

View File

@ -23,6 +23,11 @@ poetry init
### Libraries worth integrating ### Libraries worth integrating
- [pytest](https://github.com/pytest-dev/pytest) Testing framework for Python
```sh
poetry add --group dev pytest
```
- [tophat/syrupy](https://github.com/tophat/syrupy) Snapshot testing plugin for (builtin) pytest - [tophat/syrupy](https://github.com/tophat/syrupy) Snapshot testing plugin for (builtin) pytest
```sh ```sh