Merge pull request 'py-poetry template + pyright instead of pylsp' (#7) from top-level-wip into master
Reviewed-on: #7std^2
commit
4f13c01728
40
flake.lock
40
flake.lock
|
@ -117,11 +117,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673737886,
|
"lastModified": 1673948101,
|
||||||
"narHash": "sha256-hNTqD0uIgpbtTI2Nuj/Q1lEFOOdZqqXpxoc8rMno2F0=",
|
"narHash": "sha256-cD0OzFfnLFeeaz4jVszH9QiMTn+PBxmcYzrp+xujpwM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "2827b5306462d91edec16a3d069b2d6e54c3079f",
|
"rev": "bd3efacb82c721edad1ce9eda583df5fb62ab00a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -156,11 +156,11 @@
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "contrib",
|
"dir": "contrib",
|
||||||
"lastModified": 1673746461,
|
"lastModified": 1673937267,
|
||||||
"narHash": "sha256-Y21pbVNlPWPokXFbngSahnxeCff0LX+LKdDktEBIVm4=",
|
"narHash": "sha256-zixnItZtMZRKK0bEh8UOBeh8JT4jeMzPR2TtacfXmyE=",
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"repo": "neovim",
|
"repo": "neovim",
|
||||||
"rev": "6134c1e8a39a5e61d0593613343a5923a86e3545",
|
"rev": "2093e574c6c934a718f96d0a173aa965d3958a8b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -177,11 +177,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673770422,
|
"lastModified": 1673943288,
|
||||||
"narHash": "sha256-hYVEUzvqobxAM2FZfWTrTLKKNfkOSfsm0uGqNoSiIvw=",
|
"narHash": "sha256-TDo9wDfZH+MJ/tTeCtZ67jdHqtVvIxetLpFN9+vqZ7g=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "neovim-nightly-overlay",
|
"repo": "neovim-nightly-overlay",
|
||||||
"rev": "fd8e5953cfeada345d7daeedce6ab0919f1284d4",
|
"rev": "3c0bb335936754a2683a84ddf081594ddb567a89",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -226,6 +226,21 @@
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixlib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1673743903,
|
||||||
|
"narHash": "sha256-sloY6KYyVOozJ1CkbgJPpZ99TKIjIvM+04V48C04sMQ=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "7555e2dfcbac1533f047021f1744ac8871150f9f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671983799,
|
"lastModified": 1671983799,
|
||||||
|
@ -298,6 +313,7 @@
|
||||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nixgl": "nixgl",
|
"nixgl": "nixgl",
|
||||||
|
"nixlib": "nixlib",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
}
|
}
|
||||||
|
@ -308,11 +324,11 @@
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673749717,
|
"lastModified": 1673922364,
|
||||||
"narHash": "sha256-hgrw8w/AThRWfVafx3EO3/TQlGcUou4nui8X47cVhXo=",
|
"narHash": "sha256-U0XIY/Y/x4fFtlCZKMtWlqOYUnLiXj4F42GQHxWuPow=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "aab6eb2dfc7a1e42d94b6f24ef13639ff8544af4",
|
"rev": "4e0f9b8a5102387f8d19901bced16a256a6ccdc7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
69
flake.nix
69
flake.nix
|
@ -1,10 +1,15 @@
|
||||||
{
|
{
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
|
accept-flake-config = true;
|
||||||
|
experimental-features = "nix-command flakes";
|
||||||
|
# for darwin's browser
|
||||||
|
allowUnsupportedSystem = true;
|
||||||
};
|
};
|
||||||
description = "My personal configuration in Nix (and some native configurations)";
|
description = "My personal configuration in Nix (and some native configurations)";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
|
# continously merged & rebased lightweight .lib. Basically a huge extension to c_.
|
||||||
|
nixlib.url = "github:nix-community/nixpkgs.lib";
|
||||||
agenix = {
|
agenix = {
|
||||||
url = "github:ryantm/agenix";
|
url = "github:ryantm/agenix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
@ -45,8 +50,50 @@
|
||||||
, flake-compat
|
, flake-compat
|
||||||
, neovim-nightly-overlay
|
, neovim-nightly-overlay
|
||||||
, nix-index-database
|
, nix-index-database
|
||||||
|
, nixlib
|
||||||
, ...
|
, ...
|
||||||
}@_inputs:
|
}@_inputs:
|
||||||
|
let
|
||||||
|
# config_fn:: system -> config
|
||||||
|
# this function should take simple exports of homeConfigurations.${profile},
|
||||||
|
# nixosConfigurations.${profile}, devShells.${profile}, packages.${profile}
|
||||||
|
# and correctly produce
|
||||||
|
cross_platform = config_fn: let
|
||||||
|
# nixosConfigurations.${profile} -> nixosConfigurations.${system}.${profile}
|
||||||
|
# pass in: path.to.exports.nixosConfigurations
|
||||||
|
# get out: nixosConfigurations.${system} = {...}
|
||||||
|
strat_sandwich = field_name: config_field: system: {
|
||||||
|
"${field_name}"."${system}" = config_field;
|
||||||
|
};
|
||||||
|
# homeConfigurations.${profile} -> packages.${system}.homeConfigurations.${profile}
|
||||||
|
# pass in: path.to.exports.homeConfigurations
|
||||||
|
# get: packages.${system}.homeConfigurations
|
||||||
|
strat_wrap_packages = field_name: config_field: system: {
|
||||||
|
packages."${system}"."${field_name}" = config_field;
|
||||||
|
};
|
||||||
|
strat_noop = field_name: config_field: system: {"${field_name}" = config_field;};
|
||||||
|
strategyMap = {
|
||||||
|
nixosConfigurations = strat_sandwich;
|
||||||
|
templates = strat_noop;
|
||||||
|
devShells = strat_sandwich;
|
||||||
|
devShell = strat_sandwich;
|
||||||
|
formatter = strat_sandwich;
|
||||||
|
homeConfigurations = strat_wrap_packages;
|
||||||
|
lib = strat_noop;
|
||||||
|
proj_root = strat_noop;
|
||||||
|
unit_tests = strat_noop;
|
||||||
|
secrets = strat_noop;
|
||||||
|
debug = strat_noop;
|
||||||
|
};
|
||||||
|
# takes in {homeConfigurations = ...; nixosConfigurations = ...}
|
||||||
|
# -> {packages.$system.homeConfigurations}
|
||||||
|
mapConfig = config: system: (builtins.foldl'
|
||||||
|
(acc: confName: (strategyMap."${confName}" confName config."${confName}" system))
|
||||||
|
{} (builtins.attrNames config));
|
||||||
|
in builtins.foldl' nixlib.lib.recursiveUpdate {} (
|
||||||
|
builtins.map (system: (mapConfig (config_fn system) system)) flake-utils.lib.defaultSystems
|
||||||
|
);
|
||||||
|
in cross_platform (system:
|
||||||
let
|
let
|
||||||
# Context/global stuffs to be passed down
|
# Context/global stuffs to be passed down
|
||||||
# NOTE: this will only read files that are within git tree
|
# NOTE: this will only read files that are within git tree
|
||||||
|
@ -65,17 +112,9 @@
|
||||||
hosts.path = "${path}/hosts";
|
hosts.path = "${path}/hosts";
|
||||||
users.path = "${path}/users";
|
users.path = "${path}/users";
|
||||||
};
|
};
|
||||||
# TODO: adapt to different platforms think about different systems later
|
overlays = import ./overlays.nix (_inputs // {inherit system;});
|
||||||
system = "x86_64-linux";
|
|
||||||
overlays = [
|
|
||||||
rust-overlay.overlays.default
|
|
||||||
(self: pkgs@{ lib, ... }: {
|
|
||||||
lib = pkgs.lib // (import ./lib (_inputs // { inherit pkgs proj_root; }));
|
|
||||||
})
|
|
||||||
];
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system overlays;
|
||||||
overlays = import ./overlays.nix _inputs;
|
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
@ -121,7 +160,7 @@
|
||||||
inherit (hosts) nixosConfigurations;
|
inherit (hosts) nixosConfigurations;
|
||||||
inherit (users) homeConfigurations;
|
inherit (users) homeConfigurations;
|
||||||
inherit lib proj_root;
|
inherit lib proj_root;
|
||||||
devShell."${system}" = import ./dev-shell.nix final_inputs;
|
devShells = import ./dev-shell.nix final_inputs;
|
||||||
templates = import ./templates final_inputs;
|
templates = import ./templates final_inputs;
|
||||||
secrets = {
|
secrets = {
|
||||||
pubKeys = {
|
pubKeys = {
|
||||||
|
@ -130,10 +169,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
unit_tests = lib.runTests unit_tests;
|
# unit_tests = lib.runTests unit_tests;
|
||||||
debug = {
|
debug = {
|
||||||
inherit final_inputs hosts users modules lib inputs_w_lib unit_tests pkgs nixpkgs;
|
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;
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,25 +34,6 @@
|
||||||
in
|
in
|
||||||
"${mount_dest} ${confToBackendArg backend_args} :${s3fs-exec}\#${bucket}";
|
"${mount_dest} ${confToBackendArg backend_args} :${s3fs-exec}\#${bucket}";
|
||||||
personalStorage = [
|
personalStorage = [
|
||||||
# hungtr-hot @ phoenix is broken :)
|
|
||||||
# (autofs-s3fs_entry {
|
|
||||||
# mount_dest = "hot";
|
|
||||||
# backend_args = {
|
|
||||||
# "-fstype" = "fuse";
|
|
||||||
# use_cache = "/tmp";
|
|
||||||
# del_cache = null;
|
|
||||||
# allow_other = null;
|
|
||||||
# url = ''"https://f5i0.ph.idrivee2-32.com"'';
|
|
||||||
# # TODO: builtins.readFile requires a Git-controlled file
|
|
||||||
# passwd_file = config.age.secrets.s3fs.path;
|
|
||||||
# dbglevel = "debug"; # enable this for better debugging info in journalctl
|
|
||||||
# uid = "1000"; # default user
|
|
||||||
# gid = "100"; # users
|
|
||||||
# umask="003"; # others read only, fully shared for users group
|
|
||||||
# # _netdev = null; # ignored by s3fs (https://github.com/s3fs-fuse/s3fs-fuse/blob/master/src/s3fs.cpp#L4910)
|
|
||||||
# };
|
|
||||||
# bucket = "hungtr-hot";
|
|
||||||
# })
|
|
||||||
(autofs-s3fs_entry {
|
(autofs-s3fs_entry {
|
||||||
mount_dest = "garden";
|
mount_dest = "garden";
|
||||||
backend_args = {
|
backend_args = {
|
||||||
|
|
|
@ -607,7 +607,7 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
-- default language servers
|
-- default language servers
|
||||||
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', "pylsp",
|
'rnix', 'eslint', 'terraformls', 'tflint', 'svelte', 'astro', 'clojure_lsp', "bashls", 'yamlls',
|
||||||
"jsonls", "denols"
|
"jsonls", "denols"
|
||||||
}
|
}
|
||||||
require("mason").setup({
|
require("mason").setup({
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore
|
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore
|
||||||
# incremental dependencies based on the project
|
# incremental dependencies based on the project
|
||||||
|
# TODO: just install these things, then symlink to mason's bin directory
|
||||||
#
|
#
|
||||||
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
|
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
|
||||||
# might be different from `home-manager`'s
|
# might be different from `home-manager`'s
|
||||||
|
@ -44,23 +45,22 @@ let
|
||||||
pkgs.zk # Zettelkasten (limited support)
|
pkgs.zk # Zettelkasten (limited support)
|
||||||
pkgs.fd # Required by a Telescope plugin (?)
|
pkgs.fd # Required by a Telescope plugin (?)
|
||||||
pkgs.stdenv.cc.cc.lib
|
pkgs.stdenv.cc.cc.lib
|
||||||
|
pkgs.rnix-lsp # doesn't work, Mason just installs it using cargo
|
||||||
|
pkgs.rust4cargo
|
||||||
|
|
||||||
|
|
||||||
# Language-specific stuffs
|
# Language-specific stuffs
|
||||||
pkgs.sumneko-lua-language-server
|
pkgs.sumneko-lua-language-server
|
||||||
|
# pkgs.python3Packages.python-lsp-server
|
||||||
|
pkgs.nodePackages.pyright
|
||||||
|
pkgs.python3Packages.pylint
|
||||||
|
pkgs.python3Packages.flake8
|
||||||
# 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
|
||||||
|
|
||||||
# pkgs.rust-analyzer
|
# pkgs.rust-analyzer
|
||||||
# rust_pkgs
|
# rust_pkgs
|
||||||
# pkgs.evcxr # Rust REPL for Conjure!
|
# pkgs.evcxr # Rust REPL for Conjure!
|
||||||
|
|
||||||
# Python3 as alternative to bash scripts :^)
|
|
||||||
# (pkgs.python310Full.withPackages (pypkgs: [
|
|
||||||
# # python-lsp-server's dependencies is absolutely astronomous
|
|
||||||
# # pypkgs.python-lsp-server # python-lsp. Now we'll have to tell mason to look for this
|
|
||||||
# pypkgs.pynvim # nvim provider
|
|
||||||
# pypkgs.ujson # pylsp seems to rely on this. satisfy it lol
|
|
||||||
# ]))
|
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
|
# We use top-level nix-flake, so default.nix is basically just a wrapper around ./flake.nix
|
||||||
(import
|
(import
|
||||||
(
|
(
|
||||||
# Get corresponding version of flake-compat declared in on ./flake.lock
|
let
|
||||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
fetchTarball {
|
c_ = import ./../../c_.nix {src = ./.;};
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
in
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
c_.fetchTree lock.nodes.flake-compat.locked
|
||||||
}
|
|
||||||
)
|
)
|
||||||
{ src = ./.; } # calls flake.nix
|
{ src = ./.; }
|
||||||
).defaultNix
|
).defaultNix
|
||||||
|
|
||||||
|
|
|
@ -97,11 +97,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673737886,
|
"lastModified": 1673948101,
|
||||||
"narHash": "sha256-hNTqD0uIgpbtTI2Nuj/Q1lEFOOdZqqXpxoc8rMno2F0=",
|
"narHash": "sha256-cD0OzFfnLFeeaz4jVszH9QiMTn+PBxmcYzrp+xujpwM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "2827b5306462d91edec16a3d069b2d6e54c3079f",
|
"rev": "bd3efacb82c721edad1ce9eda583df5fb62ab00a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -136,11 +136,11 @@
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "contrib",
|
"dir": "contrib",
|
||||||
"lastModified": 1673746461,
|
"lastModified": 1673937267,
|
||||||
"narHash": "sha256-Y21pbVNlPWPokXFbngSahnxeCff0LX+LKdDktEBIVm4=",
|
"narHash": "sha256-zixnItZtMZRKK0bEh8UOBeh8JT4jeMzPR2TtacfXmyE=",
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"repo": "neovim",
|
"repo": "neovim",
|
||||||
"rev": "6134c1e8a39a5e61d0593613343a5923a86e3545",
|
"rev": "2093e574c6c934a718f96d0a173aa965d3958a8b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -157,11 +157,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673770422,
|
"lastModified": 1673943288,
|
||||||
"narHash": "sha256-hYVEUzvqobxAM2FZfWTrTLKKNfkOSfsm0uGqNoSiIvw=",
|
"narHash": "sha256-TDo9wDfZH+MJ/tTeCtZ67jdHqtVvIxetLpFN9+vqZ7g=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "neovim-nightly-overlay",
|
"repo": "neovim-nightly-overlay",
|
||||||
"rev": "fd8e5953cfeada345d7daeedce6ab0919f1284d4",
|
"rev": "3c0bb335936754a2683a84ddf081594ddb567a89",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -239,11 +239,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673631141,
|
"lastModified": 1673796341,
|
||||||
"narHash": "sha256-AprpYQ5JvLS4wQG/ghm2UriZ9QZXvAwh1HlgA/6ZEVQ=",
|
"narHash": "sha256-1kZi9OkukpNmOaPY7S5/+SlCDOuYnP3HkXHvNDyLQcc=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "befc83905c965adfd33e5cae49acb0351f6e0404",
|
"rev": "6dccdc458512abce8d19f74195bb20fdb067df50",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -288,11 +288,11 @@
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1673749717,
|
"lastModified": 1673922364,
|
||||||
"narHash": "sha256-hgrw8w/AThRWfVafx3EO3/TQlGcUou4nui8X47cVhXo=",
|
"narHash": "sha256-U0XIY/Y/x4fFtlCZKMtWlqOYUnLiXj4F42GQHxWuPow=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "aab6eb2dfc7a1e42d94b6f24ef13639ff8544af4",
|
"rev": "4e0f9b8a5102387f8d19901bced16a256a6ccdc7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -2,6 +2,14 @@
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
accept-flake-config = true;
|
accept-flake-config = true;
|
||||||
experimental-features = "nix-command flakes";
|
experimental-features = "nix-command flakes";
|
||||||
|
extra-substituters = [
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
"https://cache.nixos.org"
|
||||||
|
];
|
||||||
|
extra-trusted-public-keys = [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||||
|
];
|
||||||
};
|
};
|
||||||
description = "simple home-manager config";
|
description = "simple home-manager config";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
@ -56,7 +64,7 @@
|
||||||
in
|
in
|
||||||
cross_platform (system:
|
cross_platform (system:
|
||||||
let
|
let
|
||||||
overlays = import ./../../overlays.nix flake_inputs;
|
overlays = import ./../../overlays.nix (flake_inputs // {inherit system;});
|
||||||
# pkgs = nixpkgs.legacyPackages.${system}.appendOverlays overlays;
|
# pkgs = nixpkgs.legacyPackages.${system}.appendOverlays overlays;
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
|
@ -131,6 +139,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# Personal darwin, effectively serves as the Darwin edge channel
|
||||||
"hungtran" = home-manager.lib.homeManagerConfiguration {
|
"hungtran" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = base.modules ++ [
|
modules = base.modules ++ [
|
||||||
|
@ -140,10 +149,14 @@
|
||||||
# don't want to deal with GL stuffs on mac yet :/
|
# don't want to deal with GL stuffs on mac yet :/
|
||||||
base.graphics.useNixGL.defaultPackage = null;
|
base.graphics.useNixGL.defaultPackage = null;
|
||||||
# NOTE: this actually does not exist
|
# NOTE: this actually does not exist
|
||||||
base.keepass.path = "/Users/htran/keepass.kdbx";
|
base.keepass.path = "/Users/hungtran/keepass.kdbx";
|
||||||
base.alacritty.font.size = 11.0;
|
base.alacritty.font.size = 11.0;
|
||||||
}
|
}
|
||||||
nerd_font_module
|
nerd_font_module
|
||||||
|
./base/productive_desktop.nix
|
||||||
|
{
|
||||||
|
base.private_chromium.enable = false;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
extraSpecialArgs = mkModuleArgs {
|
extraSpecialArgs = mkModuleArgs {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
@ -153,6 +166,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
# Work darwin
|
||||||
"htran" = home-manager.lib.homeManagerConfiguration {
|
"htran" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = base.modules ++ [
|
modules = base.modules ++ [
|
||||||
|
@ -164,6 +178,8 @@
|
||||||
# NOTE: this actually does not exist
|
# NOTE: this actually does not exist
|
||||||
base.keepass.path = "/Users/htran/keepass.kdbx";
|
base.keepass.path = "/Users/htran/keepass.kdbx";
|
||||||
base.alacritty.font.size = 11.0;
|
base.alacritty.font.size = 11.0;
|
||||||
|
base.git.name = "Hung";
|
||||||
|
base.git.email = "htran@egihosting.com";
|
||||||
}
|
}
|
||||||
nerd_font_module
|
nerd_font_module
|
||||||
];
|
];
|
||||||
|
|
52
overlays.nix
52
overlays.nix
|
@ -1,27 +1,14 @@
|
||||||
flake_input@{ kpcli-py, nixgl, rust-overlay, neovim-nightly-overlay, ... }: [
|
flake_input@{ kpcli-py
|
||||||
|
, nixgl
|
||||||
# TODO: this is quite harmful to add globally. nixGL is built not to be pure
|
, rust-overlay
|
||||||
nixgl.overlays.default
|
, neovim-nightly-overlay
|
||||||
|
, system
|
||||||
rust-overlay.overlays.default
|
, ...
|
||||||
|
}: let
|
||||||
neovim-nightly-overlay.overlay
|
kpcli-py = (final: prev: {
|
||||||
|
|
||||||
(final: prev:
|
|
||||||
let
|
|
||||||
nightlyRustWithExts = exts: final.rust-bin.selectLatestNightlyWith (
|
|
||||||
toolchain: (toolchain.minimal.override {
|
|
||||||
extensions = exts;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
# https://rust-lang.github.io/rustup/concepts/profiles.html
|
|
||||||
rust-default-components = [ "rust-docs" "rustfmt" "clippy" ];
|
|
||||||
rust-dev-components = rust-default-components ++ [ "rust-src" "rust-analyzer" "miri" ];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# use python3.9, which works because of cython somehow?
|
# use python3.9, which works because of cython somehow?
|
||||||
kpcli-py = final.poetry2nix.mkPoetryApplication {
|
kpcli-py = final.poetry2nix.mkPoetryApplication {
|
||||||
projectDir = kpcli-py;
|
projectDir = flake_input.kpcli-py;
|
||||||
python = final.python39;
|
python = final.python39;
|
||||||
overrides = final.poetry2nix.defaultPoetryOverrides.extend (self: super: {
|
overrides = final.poetry2nix.defaultPoetryOverrides.extend (self: super: {
|
||||||
# tableformatter requires setuptools
|
# tableformatter requires setuptools
|
||||||
|
@ -32,11 +19,28 @@ flake_input@{ kpcli-py, nixgl, rust-overlay, neovim-nightly-overlay, ... }: [
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
rust = (final: prev:
|
||||||
|
let
|
||||||
|
nightlyRustWithExts = exts: final.rust-bin.selectLatestNightlyWith (
|
||||||
|
toolchain: (toolchain.minimal.override {
|
||||||
|
extensions = exts;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
# https://rust-lang.github.io/rustup/concepts/profiles.html
|
||||||
|
rust-default-components = [ "rust-docs" "rustfmt" "clippy" ];
|
||||||
|
rust-dev-components = rust-default-components ++ [ "rust-src" "rust-analyzer" "miri" ];
|
||||||
|
in {
|
||||||
rust4devs = nightlyRustWithExts rust-dev-components;
|
rust4devs = nightlyRustWithExts rust-dev-components;
|
||||||
rust4cargo = nightlyRustWithExts [ ];
|
rust4cargo = nightlyRustWithExts [ ];
|
||||||
rust4normi = nightlyRustWithExts rust-default-components;
|
rust4normi = nightlyRustWithExts rust-default-components;
|
||||||
})
|
});
|
||||||
|
in [
|
||||||
|
nixgl.overlays.default
|
||||||
|
rust-overlay.overlays.default
|
||||||
|
neovim-nightly-overlay.overlay
|
||||||
|
rust
|
||||||
|
kpcli-py
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -16,4 +16,8 @@
|
||||||
path = ./ts/turborepo;
|
path = ./ts/turborepo;
|
||||||
description = "Typescript monorepo with tsconfig, eslint, but with minimal framework attached";
|
description = "Typescript monorepo with tsconfig, eslint, but with minimal framework attached";
|
||||||
};
|
};
|
||||||
|
py-poetry = {
|
||||||
|
path = ./py-poetry;
|
||||||
|
description = "Python repository with poetry & poetry2nix";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
(import
|
||||||
|
(
|
||||||
|
fetchTarball {
|
||||||
|
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
||||||
|
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
{
|
||||||
|
src = ./.;
|
||||||
|
}).defaultNix
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }:
|
||||||
|
let
|
||||||
|
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||||
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages = forAllSystems (system: {
|
||||||
|
default = pkgs.${system}.poetry2nix.mkPoetryApplication { projectDir = self; };
|
||||||
|
});
|
||||||
|
|
||||||
|
devShells = forAllSystems (system: {
|
||||||
|
default = pkgs.${system}.mkShellNoCC {
|
||||||
|
packages = with pkgs.${system}; [
|
||||||
|
(poetry2nix.mkPoetryEnv { projectDir = self; })
|
||||||
|
poetry
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
(import
|
||||||
|
(
|
||||||
|
fetchTarball {
|
||||||
|
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
||||||
|
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
{
|
||||||
|
src = ./.;
|
||||||
|
}).shellNix
|
Loading…
Reference in New Issue