Compare commits
No commits in common. "b8d7024b934409ddbf55ad985094d0db04baccf2" and "42c2413ce032e37d4b70a77ea4c1f06e695ec655" have entirely different histories.
b8d7024b93
...
42c2413ce0
|
@ -397,7 +397,7 @@ remap('n', '<leader>gs', function() require('neogit').open({}) end);
|
||||||
require("inlay-hints").setup {
|
require("inlay-hints").setup {
|
||||||
only_current_line = false,
|
only_current_line = false,
|
||||||
eol = {
|
eol = {
|
||||||
right_align = false,
|
right_align = true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
{ config
|
|
||||||
, proj_root
|
|
||||||
, myLib
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (myLib) fromYaml;
|
|
||||||
actualConfig = fromYaml (builtins.readFile "${proj_root}//alacritty/alacritty.yml");
|
|
||||||
cfg = config.base.alacritty;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.base.alacritty.font.family = myLib.mkOption {
|
|
||||||
type = myLib.types.singleLineStr;
|
|
||||||
default = actualConfig.font.normal.family;
|
|
||||||
description = ''
|
|
||||||
The font family for Alacritty
|
|
||||||
'';
|
|
||||||
example = "DroidSansMono NF";
|
|
||||||
};
|
|
||||||
options.base.alacritty.enable = myLib.mkOption {
|
|
||||||
type = myLib.types.bool;
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Enables alacritty
|
|
||||||
'';
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
config.programs.alacritty = {
|
|
||||||
enable = cfg.enable;
|
|
||||||
settings = actualConfig // {
|
|
||||||
font.normal.family = cfg.font.family;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
|
|
||||||
}:
|
|
|
@ -1,12 +0,0 @@
|
||||||
{ pkgs
|
|
||||||
, lib ? pkgs.lib
|
|
||||||
, ...
|
|
||||||
}@inputs:
|
|
||||||
let
|
|
||||||
_lib = lib // import ../../lib { inherit pkgs lib; };
|
|
||||||
in
|
|
||||||
# TODO: Unpollute inputs
|
|
||||||
inputs // {
|
|
||||||
proj_root = builtins.toString ./../../..;
|
|
||||||
myLib = _lib;
|
|
||||||
}
|
|
|
@ -45,6 +45,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"from-yaml": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667993187,
|
||||||
|
"narHash": "sha256-JG1XYGCmR7Jqawvs8AO4c2mrOl37BXGGgU9cfeL0b8k=",
|
||||||
|
"owner": "pegasust",
|
||||||
|
"repo": "fromYaml",
|
||||||
|
"rev": "ef0ed4acfc4a6b7a0f1515cb48f5dbdda89dac3c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "pegasust",
|
||||||
|
"repo": "fromYaml",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -135,6 +151,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
|
"from-yaml": "from-yaml",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixgl": "nixgl",
|
"nixgl": "nixgl",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
nixgl.url = "github:guibou/nixGL";
|
nixgl.url = "github:guibou/nixGL";
|
||||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||||
|
from-yaml = {
|
||||||
|
url = "github:pegasust/fromYaml";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
@ -17,6 +21,7 @@
|
||||||
, nixgl
|
, nixgl
|
||||||
, rust-overlay
|
, rust-overlay
|
||||||
, flake-utils
|
, flake-utils
|
||||||
|
, from-yaml
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
@ -27,8 +32,7 @@
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
config = { allowUnfree = true; };
|
config = { allowUnfree = true; };
|
||||||
};
|
};
|
||||||
# lib = (import ../lib { inherit pkgs; lib = pkgs.lib; });
|
lib = (import ../lib-nix { inherit pkgs from-yaml; lib = pkgs.lib; });
|
||||||
mkModuleArgs = import ./base/mkModuleArgs.nix;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeConfigurations =
|
homeConfigurations =
|
||||||
|
@ -47,8 +51,8 @@
|
||||||
# optionally pass inarguments to module
|
# optionally pass inarguments to module
|
||||||
# we migrate this from in-place modules to allow flexibility
|
# we migrate this from in-place modules to allow flexibility
|
||||||
# in this case, we can add "home" to input arglist of home.nix
|
# in this case, we can add "home" to input arglist of home.nix
|
||||||
extraSpecialArgs = mkModuleArgs {
|
extraSpecialArgs = {
|
||||||
inherit pkgs;
|
myLib = lib;
|
||||||
myHome = {
|
myHome = {
|
||||||
username = "hungtr";
|
username = "hungtr";
|
||||||
homeDirectory = "/home/hungtr";
|
homeDirectory = "/home/hungtr";
|
||||||
|
@ -63,8 +67,8 @@
|
||||||
# optionally pass inarguments to module
|
# optionally pass inarguments to module
|
||||||
# we migrate this from in-place modules to allow flexibility
|
# we migrate this from in-place modules to allow flexibility
|
||||||
# in this case, we can add "home" to input arglist of home.nix
|
# in this case, we can add "home" to input arglist of home.nix
|
||||||
extraSpecialArgs = mkModuleArgs {
|
extraSpecialArgs = {
|
||||||
inherit pkgs;
|
myLib = lib;
|
||||||
myHome = {
|
myHome = {
|
||||||
username = "nixos";
|
username = "nixos";
|
||||||
homeDirectory = "/home/nixos";
|
homeDirectory = "/home/nixos";
|
||||||
|
@ -95,13 +99,9 @@
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
./home.nix
|
./home.nix
|
||||||
./base/alacritty.nix
|
|
||||||
{
|
|
||||||
base.alacritty.font.family = "BitstreamVeraSansMono Nerd Font";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
extraSpecialArgs = mkModuleArgs {
|
extraSpecialArgs = {
|
||||||
inherit pkgs;
|
myLib = lib;
|
||||||
myHome = {
|
myHome = {
|
||||||
username = "hwtr";
|
username = "hwtr";
|
||||||
homeDirectory = "/home/hwtr";
|
homeDirectory = "/home/hwtr";
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
# This is a nix module, with an additional wrapper from home-manager
|
# myHome is injected from extraSpecialArgs in flake.nix
|
||||||
# myHome, myLib is injected from extraSpecialArgs in flake.nix
|
{ config
|
||||||
# This file represents the base settings for each machine
|
|
||||||
# Additional configurations goes to profiles/<user>
|
|
||||||
# or inlined in flake.nix
|
|
||||||
{ config # Represents the realized final configuration
|
|
||||||
, pkgs # This is by default just ``= import <nixpkgs>{}`
|
, pkgs # This is by default just ``= import <nixpkgs>{}`
|
||||||
, myHome
|
, myHome
|
||||||
, myLib
|
|
||||||
, option # The options we're given, this might be useful for typesafety?
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
@ -34,7 +28,20 @@ let
|
||||||
# ]))
|
# ]))
|
||||||
];
|
];
|
||||||
proj_root = builtins.toString ./../..;
|
proj_root = builtins.toString ./../..;
|
||||||
inherit (myLib) fromYaml;
|
# TODO: put this in a seperate library
|
||||||
|
# callPackage supports both PATH and function as first param!
|
||||||
|
yamlToJsonDrv = yamlContent: outputPath: pkgs.callPackage
|
||||||
|
({ runCommand }:
|
||||||
|
# runCommand source: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L33
|
||||||
|
runCommand outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
|
||||||
|
# run yq which outputs '.' (no filter) on file at yamlPath
|
||||||
|
# note that $out is passed onto the bash/sh script for execution
|
||||||
|
''
|
||||||
|
echo "$yamlContent" | yq >$out
|
||||||
|
'')
|
||||||
|
{ };
|
||||||
|
# fromYamlPath = yamlPath: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlPath "any-output.json"));
|
||||||
|
fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json"));
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home = {
|
home = {
|
||||||
|
@ -47,7 +54,10 @@ in
|
||||||
pkgs.htop
|
pkgs.htop
|
||||||
pkgs.ripgrep
|
pkgs.ripgrep
|
||||||
pkgs.unzip
|
pkgs.unzip
|
||||||
|
pkgs.rust-bin.nightly.latest.default # Needed for alacritty?
|
||||||
|
|
||||||
# pkgs.nodejs-18_x
|
# pkgs.nodejs-18_x
|
||||||
|
# pkgs.rust-analyzer # This should be very specific to env
|
||||||
|
|
||||||
|
|
||||||
# cool utilities
|
# cool utilities
|
||||||
|
@ -74,6 +84,11 @@ in
|
||||||
programs.jq = {
|
programs.jq = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
programs.alacritty = myHome.programs.alacritty or {
|
||||||
|
enable = true;
|
||||||
|
# settings = myLib.fromYaml (builtins.readFile "${proj_root}/alacritty/alacritty.yml");
|
||||||
|
settings = fromYaml (builtins.readFile "${proj_root}//alacritty/alacritty.yml");
|
||||||
|
};
|
||||||
# nix: Propagates the environment with packages and vars when enter (children of)
|
# nix: Propagates the environment with packages and vars when enter (children of)
|
||||||
# a directory with shell.nix-compatible and .envrc
|
# a directory with shell.nix-compatible and .envrc
|
||||||
programs.direnv = {
|
programs.direnv = {
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# main module exporter for different configuration profiles
|
|
||||||
{pkgs, libs,...} @ inputs:
|
|
||||||
{
|
|
||||||
hwtr = import ./hwtr.nix;
|
|
||||||
}
|
|
|
@ -1,9 +1,4 @@
|
||||||
{ pkgs
|
{pkgs, lib, from-yaml, ...}@flake_import:
|
||||||
, lib ? pkgs.lib
|
{
|
||||||
, ... }@flake_import:
|
fromYaml = import "${from-yaml}/fromYaml.nix" {inherit lib;};
|
||||||
let serde = import ./serde { inherit pkgs lib; };
|
|
||||||
in
|
|
||||||
pkgs.lib // lib // {
|
|
||||||
fromYaml = serde.fromYaml;
|
|
||||||
fromYamlPath = serde.fromYamlPath;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
# Takes care of serializing and deserializing to some formats
|
|
||||||
# Blame: Pegasust<pegasucksgg@gmail.com>
|
|
||||||
# TODO: Add to* formats from pkgs.formats.*
|
|
||||||
{ pkgs
|
|
||||||
, lib
|
|
||||||
} @ inputs:
|
|
||||||
let
|
|
||||||
yamlToJsonDrv = yamlContent: outputPath: pkgs.callPackage
|
|
||||||
({ runCommand }:
|
|
||||||
# runCommand source: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L33
|
|
||||||
runCommand outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
|
|
||||||
# run yq which outputs '.' (no filter) on file at yamlPath
|
|
||||||
# note that $out is passed onto the bash/sh script for execution
|
|
||||||
''
|
|
||||||
echo "$yamlContent" | yq >$out
|
|
||||||
'')
|
|
||||||
{ };
|
|
||||||
in {
|
|
||||||
# Takes in a yaml string and produces a derivation with translated JSON at $outputPath
|
|
||||||
# similar to builtins.fromJSON, turns a YAML string to nix attrset
|
|
||||||
fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json"));
|
|
||||||
fromYamlPath = yamlPath: builtins.fromJSON (
|
|
||||||
builtins.readFile (
|
|
||||||
yamlToJsonDrv (
|
|
||||||
builtins.readFile yamlPath)
|
|
||||||
"any-output.json"));
|
|
||||||
# TODO: fromToml?
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
# This module aims to be merge (not inject/override) with top-level pkgs to provide
|
# This module aims to be merge (not inject/override) with top-level pkgs to provide
|
||||||
# personalized/custom packages
|
# personalized/custom packages
|
||||||
{ pkgs, lib, ... }@pkgs_input: {
|
{ pkgs, lib, ... }@pkgs_input: {
|
||||||
# dot-hwtr = import "./dot-hwtr" pkgs_input;
|
dot-hwtr = import "./dot-hwtr" pkgs_input;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
{ pkgs, lib, ... }@pkgs_input: pkgs.stdenv.mkDerivation {
|
||||||
|
name = "dot-hwtr";
|
||||||
|
native
|
||||||
|
}
|
|
@ -10,7 +10,7 @@ HOME_MANAGER_DIR="${SCRIPT_DIR}/../nix-conf/home-manager"
|
||||||
|
|
||||||
# test if we have home-manager, if not, attempt to use nix to put home-manager to
|
# test if we have home-manager, if not, attempt to use nix to put home-manager to
|
||||||
# our environment
|
# our environment
|
||||||
if [ $(home-manager >/dev/null 2>&1) ]; then
|
if [ $(home-manager &>/dev/null) ]; then
|
||||||
nix-shell -p home-manager --run "home-manager switch --flake $HOME_MANAGER_DIR"
|
nix-shell -p home-manager --run "home-manager switch --flake $HOME_MANAGER_DIR"
|
||||||
else
|
else
|
||||||
home-manager switch --flake "$HOME_MANAGER_DIR"
|
home-manager switch --flake "$HOME_MANAGER_DIR"
|
||||||
|
|
Loading…
Reference in New Issue