fix: Format according to nixfmt-rfc-style
This commit is contained in:
parent
e3e96bbf40
commit
ce37942672
24 changed files with 606 additions and 302 deletions
|
@ -5,13 +5,32 @@ let
|
|||
url = "https://raw.githubusercontent.com/rust-lang/mdBook/7b9bd5049ce15ae5f301d5a40c50ce8359d9e9a8/src/theme/highlight.js";
|
||||
hash = "sha256-pLP73zlmGkbC/zV6bwnB6ijRf9gVkj5/VYMGLhiQ1/Q=";
|
||||
};
|
||||
filterVisible = toplevelOption: option: option // { visible = option.visible && builtins.elemAt option.loc 0 == toplevelOption; };
|
||||
home-eval = lib.evalModules { modules = [ ../home/options.nix ]; specialArgs = { inherit pkgs; }; };
|
||||
filterVisible =
|
||||
toplevelOption: option:
|
||||
option // { visible = option.visible && builtins.elemAt option.loc 0 == toplevelOption; };
|
||||
home-eval = lib.evalModules {
|
||||
modules = [ ../home/options.nix ];
|
||||
specialArgs = {
|
||||
inherit pkgs;
|
||||
};
|
||||
};
|
||||
nvim-eval = lib.evalModules { modules = [ ../nvim/options.nix ]; };
|
||||
nixos-eval = lib.evalModules { modules = [ ../system/options.nix ]; };
|
||||
home-markdown = (pkgs.nixosOptionsDoc { inherit (home-eval) options; transformOptions = filterVisible "jhome"; }).optionsCommonMark;
|
||||
nvim-markdown = (pkgs.nixosOptionsDoc { inherit (nvim-eval) options; transformOptions = filterVisible "jhome"; }).optionsCommonMark;
|
||||
nixos-markdown = (pkgs.nixosOptionsDoc { inherit (nixos-eval) options; transformOptions = filterVisible "jconfig"; }).optionsCommonMark;
|
||||
home-markdown =
|
||||
(pkgs.nixosOptionsDoc {
|
||||
inherit (home-eval) options;
|
||||
transformOptions = filterVisible "jhome";
|
||||
}).optionsCommonMark;
|
||||
nvim-markdown =
|
||||
(pkgs.nixosOptionsDoc {
|
||||
inherit (nvim-eval) options;
|
||||
transformOptions = filterVisible "jhome";
|
||||
}).optionsCommonMark;
|
||||
nixos-markdown =
|
||||
(pkgs.nixosOptionsDoc {
|
||||
inherit (nixos-eval) options;
|
||||
transformOptions = filterVisible "jconfig";
|
||||
}).optionsCommonMark;
|
||||
in
|
||||
{
|
||||
inherit nixos-markdown nvim-markdown home-markdown;
|
||||
|
|
110
flake.nix
110
flake.nix
|
@ -36,48 +36,72 @@
|
|||
|
||||
# Flake outputs that other flakes can use
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, stylix
|
||||
, home-manager
|
||||
, nixos-hardware
|
||||
, pre-commit-hooks
|
||||
, jpassmenu
|
||||
, audiomenu
|
||||
, nixvim
|
||||
, neovim-nightly
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
stylix,
|
||||
home-manager,
|
||||
nixos-hardware,
|
||||
pre-commit-hooks,
|
||||
jpassmenu,
|
||||
audiomenu,
|
||||
nixvim,
|
||||
neovim-nightly,
|
||||
}:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
# Helpers for producing system-specific outputs
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
forEachSupportedSystem =
|
||||
f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (
|
||||
system:
|
||||
f {
|
||||
inherit system;
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
});
|
||||
}
|
||||
);
|
||||
overlays = builtins.attrValues self.overlays;
|
||||
in
|
||||
{
|
||||
checks = forEachSupportedSystem ({ pkgs, system }: {
|
||||
checks = forEachSupportedSystem (
|
||||
{ pkgs, system }:
|
||||
{
|
||||
nvim = nixvim.lib.${system}.check.mkTestDerivationFromNixvimModule {
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
module = ./nvim/nixvim.nix;
|
||||
};
|
||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||
src = builtins.path { path = ./.; name = "configuration.nix"; };
|
||||
hooks.typos.enable = true;
|
||||
hooks.nixpkgs-fmt.enable = true;
|
||||
src = builtins.path {
|
||||
path = ./.;
|
||||
name = "configuration.nix";
|
||||
};
|
||||
});
|
||||
hooks.typos.enable = true;
|
||||
hooks.nixfmt.enable = true;
|
||||
hooks.nixfmt.package = pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
packages = forEachSupportedSystem ({ pkgs, system }: {
|
||||
inherit (import ./docs { inherit pkgs lib; }) docs nixos-markdown nvim-markdown home-markdown;
|
||||
packages = forEachSupportedSystem (
|
||||
{ pkgs, system }:
|
||||
{
|
||||
inherit (import ./docs { inherit pkgs lib; })
|
||||
docs
|
||||
nixos-markdown
|
||||
nvim-markdown
|
||||
home-markdown
|
||||
;
|
||||
# Nvim standalone module
|
||||
nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
module = ./nvim/nixvim.nix;
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
# Provide necessary overlays
|
||||
overlays = {
|
||||
|
@ -86,7 +110,8 @@
|
|||
jpassmenu = jpassmenu.overlays.default;
|
||||
audiomenu = audiomenu.overlays.default;
|
||||
"waybar-sway-patch" = final: prev: {
|
||||
waybar = prev.waybar.overrideAttrs (old:
|
||||
waybar = prev.waybar.overrideAttrs (
|
||||
old:
|
||||
let
|
||||
# Fixes https://github.com/Alexays/Waybar/issues/3009
|
||||
patch = final.fetchpatch {
|
||||
|
@ -97,7 +122,10 @@
|
|||
# Deduplicate patch
|
||||
present = builtins.elem patch prevPatches;
|
||||
in
|
||||
{ patches = prevPatches ++ final.lib.optional (!present) patch; });
|
||||
{
|
||||
patches = prevPatches ++ final.lib.optional (!present) patch;
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -108,13 +136,10 @@
|
|||
nixosConfigurations.vm =
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"steam-original"
|
||||
];
|
||||
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-original" ];
|
||||
pkgs = import nixpkgs { inherit system overlays config; };
|
||||
in
|
||||
lib.nixosSystem
|
||||
{
|
||||
lib.nixosSystem {
|
||||
inherit system pkgs;
|
||||
modules = [
|
||||
self.nixosModules.vm # import vm module
|
||||
|
@ -124,7 +149,11 @@
|
|||
|
||||
users.users.jdoe.password = "example";
|
||||
users.users.jdoe.isNormalUser = true;
|
||||
users.users.jdoe.extraGroups = [ "wheel" "video" "networkmanager" ];
|
||||
users.users.jdoe.extraGroups = [
|
||||
"wheel"
|
||||
"video"
|
||||
"networkmanager"
|
||||
];
|
||||
|
||||
home-manager.users.jdoe = {
|
||||
home.username = "jdoe";
|
||||
|
@ -143,7 +172,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
|
||||
nixosModules =
|
||||
let
|
||||
nvim-config.imports = [
|
||||
|
@ -167,7 +195,12 @@
|
|||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
};
|
||||
|
||||
machines = [ "capricorn" "gemini" "libra" "vm" ];
|
||||
machines = [
|
||||
"capricorn"
|
||||
"gemini"
|
||||
"libra"
|
||||
"vm"
|
||||
];
|
||||
mkMachine = hostname: {
|
||||
imports = [
|
||||
nixosModule
|
||||
|
@ -180,14 +213,21 @@
|
|||
{
|
||||
default = nixosModule;
|
||||
inherit nixosModule homeManagerModuleNixOS homeManagerModuleSandalone;
|
||||
} // machineModules;
|
||||
}
|
||||
// machineModules;
|
||||
|
||||
devShells = forEachSupportedSystem ({ pkgs, system }: {
|
||||
devShells = forEachSupportedSystem (
|
||||
{ pkgs, system }:
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||
buildInputs = with pkgs; [ just self.packages.${system}.nvim ];
|
||||
buildInputs = with pkgs; [
|
||||
just
|
||||
self.packages.${system}.nvim
|
||||
];
|
||||
QEMU_OPTS_WL = "-smp 4 -device virtio-gpu-rutabaga,gfxstream-vulkan=on,cross-domain=on,hostmem=2G,wsi=headless";
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,17 +1,33 @@
|
|||
{ overlays, nvim-config, stylix ? null }: { config, pkgs, lib, ... }:
|
||||
{
|
||||
overlays,
|
||||
nvim-config,
|
||||
stylix ? null,
|
||||
}:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.jhome;
|
||||
devcfg = cfg.dev;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
imports =
|
||||
[
|
||||
# Apply overlays
|
||||
{ nixpkgs = { inherit overlays; }; }
|
||||
{
|
||||
nixpkgs = {
|
||||
inherit overlays;
|
||||
};
|
||||
}
|
||||
nvim-config
|
||||
./options.nix
|
||||
./gui
|
||||
./users.nix
|
||||
] ++ lib.optionals (stylix != null) [
|
||||
]
|
||||
++ lib.optionals (stylix != null) [
|
||||
stylix.homeManagerModules.stylix
|
||||
{
|
||||
stylix.image = builtins.fetchurl {
|
||||
|
@ -65,7 +81,8 @@ in
|
|||
# GPG Agent
|
||||
services.gpg-agent.enable = true;
|
||||
services.gpg-agent.maxCacheTtl = 86400;
|
||||
services.gpg-agent.pinentryPackage = if config.jhome.gui.enable then pkgs.pinentry-qt else pkgs.pinentry-curses;
|
||||
services.gpg-agent.pinentryPackage =
|
||||
if config.jhome.gui.enable then pkgs.pinentry-qt else pkgs.pinentry-curses;
|
||||
services.gpg-agent.extraConfig = "allow-preset-passphrase";
|
||||
# Spotifyd
|
||||
services.spotifyd.enable = true;
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{ config, lib, pkgs, osConfig ? null, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig ? null,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (config) jhome;
|
||||
flatpakEnabled = if osConfig != null then osConfig.services.flatpak.enable else false;
|
||||
|
|
|
@ -5,30 +5,60 @@ let
|
|||
selectAudio = "${pkgs.audiomenu}/bin/audiomenu --menu 'fuzzel --dmenu'";
|
||||
swayconf = config.wayland.windowManager.sway.config;
|
||||
mod = swayconf.modifier;
|
||||
workspaces = map toString [ 1 2 3 4 5 6 7 8 9 ];
|
||||
workspaces = map toString [
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
];
|
||||
dirs =
|
||||
map
|
||||
(dir: {
|
||||
key = swayconf.${dir};
|
||||
arrow = dir;
|
||||
direction = dir;
|
||||
}) [ "up" "down" "left" "right" ];
|
||||
})
|
||||
[
|
||||
"up"
|
||||
"down"
|
||||
"left"
|
||||
"right"
|
||||
];
|
||||
joinKeys = builtins.concatStringsSep "+";
|
||||
# Generate a keybind from a modifier prefix and a key
|
||||
keycombo = prefix: key: joinKeys (prefix ++ [ key ]);
|
||||
modKeybind = keycombo [ mod ];
|
||||
modCtrlKeybind = keycombo [ mod "Ctrl" ];
|
||||
modShiftKeybind = keycombo [ mod "Shift" ];
|
||||
modCtrlShiftKeybind = keycombo [ mod "Ctrl" "Shift" ];
|
||||
modCtrlKeybind = keycombo [
|
||||
mod
|
||||
"Ctrl"
|
||||
];
|
||||
modShiftKeybind = keycombo [
|
||||
mod
|
||||
"Shift"
|
||||
];
|
||||
modCtrlShiftKeybind = keycombo [
|
||||
mod
|
||||
"Ctrl"
|
||||
"Shift"
|
||||
];
|
||||
dir2resize.up = "resize grow height";
|
||||
dir2resize.down = "resize shrink height";
|
||||
dir2resize.right = "resize grow width";
|
||||
dir2resize.left = "resize shrink width";
|
||||
# Bind a key combo to an action
|
||||
genKeybind = prefix: action: key: { "${prefix key}" = "${action key}"; };
|
||||
genKey = prefix: action: genKeybind ({ key, ... }: prefix key) ({ direction, ... }: action direction);
|
||||
genArrow = prefix: action: genKeybind ({ arrow, ... }: prefix arrow) ({ direction, ... }: action direction);
|
||||
genArrowAndKey = prefix: action: key: (genKey prefix action key) // (genArrow prefix action key);
|
||||
genKey =
|
||||
prefix: action: genKeybind ({ key, ... }: prefix key) ({ direction, ... }: action direction);
|
||||
genArrow =
|
||||
prefix: action: genKeybind ({ arrow, ... }: prefix arrow) ({ direction, ... }: action direction);
|
||||
genArrowAndKey =
|
||||
prefix: action: key:
|
||||
(genKey prefix action key) // (genArrow prefix action key);
|
||||
# Move window
|
||||
moveWindowKeybinds = map (genArrowAndKey modShiftKeybind (dir: "move ${dir}")) dirs;
|
||||
# Focus window
|
||||
|
@ -36,11 +66,17 @@ let
|
|||
# Resize window
|
||||
resizeWindowKeybinds = map (genArrowAndKey modCtrlKeybind (dir: dir2resize.${dir})) dirs;
|
||||
# Move container to workspace
|
||||
moveWorkspaceKeybindings = map (genKeybind modShiftKeybind (number: "move container to workspace number ${number}")) workspaces;
|
||||
moveWorkspaceKeybindings = map (genKeybind modShiftKeybind (
|
||||
number: "move container to workspace number ${number}"
|
||||
)) workspaces;
|
||||
# Focus workspace
|
||||
focusWorkspaceKeybindings = map (genKeybind modKeybind (number: "workspace number ${number}")) workspaces;
|
||||
focusWorkspaceKeybindings = map (genKeybind modKeybind (
|
||||
number: "workspace number ${number}"
|
||||
)) workspaces;
|
||||
# Move container to Workspace and focus on it
|
||||
moveFocusWorkspaceKeybindings = map (genKeybind modCtrlShiftKeybind (number: "move container to workspace number ${number}; workspace number ${number}")) workspaces;
|
||||
moveFocusWorkspaceKeybindings = map (genKeybind modCtrlShiftKeybind (
|
||||
number: "move container to workspace number ${number}; workspace number ${number}"
|
||||
)) workspaces;
|
||||
in
|
||||
builtins.foldl' (l: r: l // r)
|
||||
{
|
||||
|
@ -71,9 +107,11 @@ builtins.foldl' (l: r: l // r)
|
|||
"${mod}+r" = "reload";
|
||||
"${mod}+Shift+m" = "exit";
|
||||
}
|
||||
(focusWindowKeybinds
|
||||
(
|
||||
focusWindowKeybinds
|
||||
++ moveWindowKeybinds
|
||||
++ resizeWindowKeybinds
|
||||
++ focusWorkspaceKeybindings
|
||||
++ moveWorkspaceKeybindings
|
||||
++ moveFocusWorkspaceKeybindings)
|
||||
++ moveFocusWorkspaceKeybindings
|
||||
)
|
||||
|
|
|
@ -22,8 +22,7 @@ let
|
|||
schema = pkgs.gsettings-desktop-schemas;
|
||||
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
|
||||
in
|
||||
pkgs.writers.writeDashBin "configure-gtk"
|
||||
''
|
||||
pkgs.writers.writeDashBin "configure-gtk" ''
|
||||
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
|
||||
gnome_schema=org.gnome.desktop.interface
|
||||
config="${config.xdg.configHome}/gtk-3.0/settings.ini"
|
||||
|
@ -60,15 +59,23 @@ in
|
|||
window.border = 2;
|
||||
# Make certain windows floating
|
||||
window.commands = [
|
||||
{ command = "floating enable"; criteria.title = "zoom"; }
|
||||
{ command = "floating enable"; criteria.class = "floating"; }
|
||||
{ command = "floating enable"; criteria.app_id = "floating"; }
|
||||
{
|
||||
command = "floating enable";
|
||||
criteria.title = "zoom";
|
||||
}
|
||||
{
|
||||
command = "floating enable";
|
||||
criteria.class = "floating";
|
||||
}
|
||||
{
|
||||
command = "floating enable";
|
||||
criteria.app_id = "floating";
|
||||
}
|
||||
];
|
||||
# Startup scripts
|
||||
startup =
|
||||
[ (cmdAlways "${configure-gtk}/bin/configure-gtk") ]
|
||||
++ (builtins.map cmdAlways cfg.exec.always)
|
||||
++ (builtins.map cmdOnce cfg.exec.once);
|
||||
startup = [
|
||||
(cmdAlways "${configure-gtk}/bin/configure-gtk")
|
||||
] ++ (builtins.map cmdAlways cfg.exec.always) ++ (builtins.map cmdOnce cfg.exec.once);
|
||||
# Keyboard configuration
|
||||
input."type:keyboard" = {
|
||||
repeat_delay = "300";
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{ config, lib }:
|
||||
let cfg = config.jhome.gui; in
|
||||
let
|
||||
cfg = config.jhome.gui;
|
||||
in
|
||||
{
|
||||
mainBar.layer = "top";
|
||||
mainBar.position = "top";
|
||||
|
@ -7,9 +9,13 @@ let cfg = config.jhome.gui; in
|
|||
# Choose the order of the modules
|
||||
mainBar.modules-left = [ "sway/workspaces" ];
|
||||
mainBar.modules-center = [ "clock" ];
|
||||
mainBar.modules-right = [ "pulseaudio" "backlight" "battery" "sway/language" "memory" ]
|
||||
++ lib.optional (cfg.tempInfo != null) "temperature"
|
||||
++ [ "tray" ];
|
||||
mainBar.modules-right = [
|
||||
"pulseaudio"
|
||||
"backlight"
|
||||
"battery"
|
||||
"sway/language"
|
||||
"memory"
|
||||
] ++ lib.optional (cfg.tempInfo != null) "temperature" ++ [ "tray" ];
|
||||
mainBar."sway/workspaces".disable-scroll = true;
|
||||
mainBar."sway/workspaces".persistent-workspaces."1" = [ ];
|
||||
mainBar."sway/workspaces".persistent-workspaces."2" = [ ];
|
||||
|
@ -41,20 +47,37 @@ let cfg = config.jhome.gui; in
|
|||
mainBar.pulseaudio.format-icons.phone = "";
|
||||
mainBar.pulseaudio.format-icons.portable = "";
|
||||
mainBar.pulseaudio.format-icons.car = "";
|
||||
mainBar.pulseaudio.format-icons.default = [ "" "" "" ];
|
||||
mainBar.pulseaudio.format-icons.default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
mainBar.pulseaudio.on-click = "pavucontrol";
|
||||
mainBar.pulseaudio.min-length = 13;
|
||||
mainBar.temperature =
|
||||
lib.optionalAttrs (cfg.tempInfo != null) {
|
||||
mainBar.temperature = lib.optionalAttrs (cfg.tempInfo != null) {
|
||||
inherit (cfg.tempInfo) hwmon-path;
|
||||
critical-threshold = 80;
|
||||
format = "{temperatureC}°C {icon}";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
tooltip = false;
|
||||
};
|
||||
mainBar.backlight.device = "intel_backlight";
|
||||
mainBar.backlight.format = "{percent}% {icon}";
|
||||
mainBar.backlight.format-icons = [ "" "" "" "" "" "" "" ];
|
||||
mainBar.backlight.format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
mainBar.backlight.min-length = 7;
|
||||
mainBar.battery.states.warning = 30;
|
||||
mainBar.battery.states.critical = 15;
|
||||
|
@ -62,7 +85,18 @@ let cfg = config.jhome.gui; in
|
|||
mainBar.battery.format-charging = "{capacity}% ";
|
||||
mainBar.battery.format-plugged = "{capacity}% ";
|
||||
mainBar.battery.format-alt = "{time} {icon}";
|
||||
mainBar.battery.format-icons = [ "" "" "" "" "" "" "" "" "" "" ];
|
||||
mainBar.battery.format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
mainBar.tray.icon-size = 16;
|
||||
mainBar.tray.spacing = 0;
|
||||
}
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
let
|
||||
inherit (lib) types;
|
||||
|
||||
mkExtraPackagesOption = name: defaultPkgsPath:
|
||||
mkExtraPackagesOption =
|
||||
name: defaultPkgsPath:
|
||||
let
|
||||
text = lib.strings.concatMapStringsSep " " (pkgPath: "pkgs." + (lib.strings.concatStringsSep "." pkgPath)) defaultPkgsPath;
|
||||
text = lib.strings.concatMapStringsSep " " (
|
||||
pkgPath: "pkgs." + (lib.strings.concatStringsSep "." pkgPath)
|
||||
) defaultPkgsPath;
|
||||
defaultText = lib.literalExpression "[ ${text} ]";
|
||||
default = builtins.map (pkgPath: lib.attrsets.getAttrFromPath pkgPath pkgs) defaultPkgsPath;
|
||||
in
|
||||
|
@ -126,7 +129,10 @@ let
|
|||
description = "The terminal emulator to use.";
|
||||
default = "wezterm";
|
||||
example = "alacritty";
|
||||
type = types.enum [ "wezterm" "alacritty" ];
|
||||
type = types.enum [
|
||||
"wezterm"
|
||||
"alacritty"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
|
@ -20,10 +20,12 @@ in
|
|||
};
|
||||
})
|
||||
(lib.mkIf unlockKey {
|
||||
xdg.configFile.pam-gnupg.text = ''
|
||||
xdg.configFile.pam-gnupg.text =
|
||||
''
|
||||
${gpgHome}
|
||||
|
||||
'' + (lib.strings.concatLines cfg.gpg.unlockKeys);
|
||||
''
|
||||
+ (lib.strings.concatLines cfg.gpg.unlockKeys);
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{ nixos-hardware }: {
|
||||
{ nixos-hardware }:
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
@ -11,7 +12,10 @@
|
|||
# Setup extra filesystem options
|
||||
fileSystems."/".options = [ "compress=zstd" ];
|
||||
fileSystems."/home".options = [ "compress=zstd" ];
|
||||
fileSystems."/nix".options = [ "compress=zstd" "noatime" ];
|
||||
fileSystems."/nix".options = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
|
@ -24,7 +28,12 @@
|
|||
networking.hostName = "capricorn";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.networkmanager.wifi.backend = "iwd";
|
||||
networking.networkmanager.appendNameservers = [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ];
|
||||
networking.networkmanager.appendNameservers = [
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
"8.8.8.8"
|
||||
"8.4.4.8"
|
||||
];
|
||||
|
||||
console.useXkbConfig = true;
|
||||
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
@ -33,9 +42,7 @@
|
|||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-label/NIXSWAP"; }
|
||||
];
|
||||
swapDevices = [ { device = "/dev/disk/by-label/NIXSWAP"; } ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
{ nixos-hardware }: { pkgs, ... }: {
|
||||
{ nixos-hardware }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
@ -15,7 +17,10 @@
|
|||
fileSystems."/".options = [ "compress=zstd" ];
|
||||
fileSystems."/steam".options = [ "compress=zstd" ];
|
||||
fileSystems."/home".options = [ "compress=zstd" ];
|
||||
fileSystems."/nix".options = [ "compress=zstd" "noatime" ];
|
||||
fileSystems."/nix".options = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, modulesPath, ... }: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
@ -40,11 +51,7 @@
|
|||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/disk/by-label/SWAP";
|
||||
}
|
||||
];
|
||||
swapDevices = [ { device = "/dev/disk/by-label/SWAP"; } ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page, on
|
||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||
|
||||
{ nixos-hardware }: { pkgs, ... }: {
|
||||
{ nixos-hardware }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
@ -16,7 +18,10 @@
|
|||
fileSystems = {
|
||||
"/".options = [ "compress=zstd" ];
|
||||
"/home".options = [ "compress=zstd" ];
|
||||
"/nix".options = [ "compress=zstd" "noatime" ];
|
||||
"/nix".options = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
@ -36,7 +41,12 @@
|
|||
networking.hostName = "libra";
|
||||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
# networking.networkmanager.wifi.backend = "iwd"; # Seems to cause problems
|
||||
networking.networkmanager.appendNameservers = [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ];
|
||||
networking.networkmanager.appendNameservers = [
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
"8.8.8.8"
|
||||
"8.4.4.8"
|
||||
];
|
||||
|
||||
# Select internationalisation properties.
|
||||
console.useXkbConfig = true; # use xkb.options in tty.
|
||||
|
@ -65,4 +75,3 @@
|
|||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "23.11"; # Did you read the comment?
|
||||
}
|
||||
|
||||
|
|
|
@ -1,42 +1,46 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports =
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/efbda7f0-c286-4fb1-b780-d3128e4d1a3e";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=root" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/efbda7f0-c286-4fb1-b780-d3128e4d1a3e";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=home" ];
|
||||
};
|
||||
|
||||
fileSystems."/nix" =
|
||||
{
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/efbda7f0-c286-4fb1-b780-d3128e4d1a3e";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=nix" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/4E80-8B60";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{ ... }: {
|
||||
{ ... }:
|
||||
{
|
||||
services.qemuGuest.enable = true;
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{ pkgs, ... } @ opts: {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
{ pkgs, ... }@opts:
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config.programs.nixvim = (import ./nixvim.nix opts).config;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ pkgs, lib, config, ... } @ args:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}@args:
|
||||
let
|
||||
cfg = config.jhome.nvim;
|
||||
hmAvailable = args ? hmConfig;
|
||||
|
@ -8,9 +13,7 @@ let
|
|||
notStandalone = hmAvailable || nixosAvailable || darwinAvailable;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.optionalAttrs canSetAsDefault { defaultEditor = lib.mkDefault true; })
|
||||
|
@ -49,9 +52,7 @@ in
|
|||
plugins = import ./plugins.nix { inherit lib; };
|
||||
keymaps = import ./mappings.nix;
|
||||
inherit (import ./augroups.nix) autoGroups autoCmd;
|
||||
extraPlugins = with pkgs.vimPlugins; [
|
||||
nvim-web-devicons
|
||||
];
|
||||
extraPlugins = with pkgs.vimPlugins; [ nvim-web-devicons ];
|
||||
# Formatting
|
||||
extraPackages = with pkgs; [
|
||||
stylua
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
{ lib, ... }: {
|
||||
options.jhome.nvim.enable = lib.mkEnableOption "jalil's neovim configuration" // { default = true; example = false; };
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.jhome.nvim.enable = lib.mkEnableOption "jalil's neovim configuration" // {
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{ lib }: {
|
||||
{ lib }:
|
||||
{
|
||||
bacon = {
|
||||
enable = true;
|
||||
settings.quickfix.enabled = true;
|
||||
|
@ -8,11 +9,17 @@
|
|||
cmdline = {
|
||||
"/" = {
|
||||
mapping.__raw = "cmp.mapping.preset.cmdline()";
|
||||
sources = [{ name = "rg"; } { name = "buffer"; }];
|
||||
sources = [
|
||||
{ name = "rg"; }
|
||||
{ name = "buffer"; }
|
||||
];
|
||||
};
|
||||
":" = {
|
||||
mapping.__raw = "cmp.mapping.preset.cmdline()";
|
||||
sources = [{ name = "path"; } { name = "cmdline"; }];
|
||||
sources = [
|
||||
{ name = "path"; }
|
||||
{ name = "cmdline"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
settings = {
|
||||
|
@ -20,18 +27,54 @@
|
|||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
# Completion Sources
|
||||
sources = [
|
||||
{ name = "buffer"; groupIndex = 3; }
|
||||
{ name = "calc"; groupIndex = 2; }
|
||||
{ name = "conventionalcommits"; groupIndex = 1; }
|
||||
{ name = "crates"; groupIndex = 1; }
|
||||
{ name = "luasnip"; groupIndex = 1; }
|
||||
{ name = "nvim_lsp"; groupIndex = 1; }
|
||||
{ name = "nvim_lsp_document_symbol"; groupIndex = 1; }
|
||||
{ name = "nvim_lsp_signature_help"; groupIndex = 1; }
|
||||
{ name = "path"; groupIndex = 2; }
|
||||
{ name = "spell"; groupIndex = 2; }
|
||||
{ name = "treesitter"; groupIndex = 2; }
|
||||
{ name = "zsh"; groupIndex = 1; }
|
||||
{
|
||||
name = "buffer";
|
||||
groupIndex = 3;
|
||||
}
|
||||
{
|
||||
name = "calc";
|
||||
groupIndex = 2;
|
||||
}
|
||||
{
|
||||
name = "conventionalcommits";
|
||||
groupIndex = 1;
|
||||
}
|
||||
{
|
||||
name = "crates";
|
||||
groupIndex = 1;
|
||||
}
|
||||
{
|
||||
name = "luasnip";
|
||||
groupIndex = 1;
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
groupIndex = 1;
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp_document_symbol";
|
||||
groupIndex = 1;
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp_signature_help";
|
||||
groupIndex = 1;
|
||||
}
|
||||
{
|
||||
name = "path";
|
||||
groupIndex = 2;
|
||||
}
|
||||
{
|
||||
name = "spell";
|
||||
groupIndex = 2;
|
||||
}
|
||||
{
|
||||
name = "treesitter";
|
||||
groupIndex = 2;
|
||||
}
|
||||
{
|
||||
name = "zsh";
|
||||
groupIndex = 1;
|
||||
}
|
||||
];
|
||||
mapping.__raw = ''
|
||||
cmp.mapping.preset.insert({
|
||||
|
@ -116,7 +159,9 @@
|
|||
};
|
||||
luasnip = {
|
||||
enable = true;
|
||||
extraConfig = { update_events = "TextChanged,TextChangedI"; };
|
||||
extraConfig = {
|
||||
update_events = "TextChanged,TextChangedI";
|
||||
};
|
||||
};
|
||||
noice = {
|
||||
enable = true;
|
||||
|
@ -162,7 +207,10 @@
|
|||
enable = true;
|
||||
lintersByFt = {
|
||||
rust = [ "typos" ];
|
||||
latex = [ "chktex" "typos" ];
|
||||
latex = [
|
||||
"chktex"
|
||||
"typos"
|
||||
];
|
||||
markdown = [ "typos" ];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
{ stylix }: { config, pkgs, lib, ... }:
|
||||
{ stylix }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.jconfig;
|
||||
keysFromGithub = lib.attrsets.mapAttrs'
|
||||
(username: sha256: {
|
||||
keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: {
|
||||
name = "pubkeys/${username}";
|
||||
value = {
|
||||
mode = "0755";
|
||||
|
@ -11,8 +16,7 @@ let
|
|||
url = "https://github.com/${username}.keys";
|
||||
};
|
||||
};
|
||||
})
|
||||
cfg.importSSHKeysFromGithub;
|
||||
}) cfg.importSSHKeysFromGithub;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
@ -65,7 +69,9 @@ in
|
|||
};
|
||||
|
||||
environment.etc = keysFromGithub;
|
||||
services.openssh.authorizedKeysFiles = builtins.map (path: "/etc/${path}") (builtins.attrNames keysFromGithub);
|
||||
services.openssh.authorizedKeysFiles = builtins.map (path: "/etc/${path}") (
|
||||
builtins.attrNames keysFromGithub
|
||||
);
|
||||
|
||||
# Default shell
|
||||
programs.zsh.enable = true;
|
||||
|
@ -82,6 +88,9 @@ in
|
|||
# run between 0 and 45min after boot if run was missed
|
||||
nix.gc.randomizedDelaySec = "45min";
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.jconfig.gui;
|
||||
enable = config.jconfig.enable && cfg.enable;
|
||||
|
@ -17,7 +22,10 @@ in
|
|||
enable = cfg.ydotool.autoStart;
|
||||
wantedBy = [ "default.target" ];
|
||||
description = "Generic command-line automation tool";
|
||||
documentation = [ "man:ydotool(1)" "man:ydotoold(8)" ];
|
||||
documentation = [
|
||||
"man:ydotool(1)"
|
||||
"man:ydotoold(8)"
|
||||
];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
|
|
|
@ -2,8 +2,20 @@
|
|||
let
|
||||
inherit (lib) types;
|
||||
# Like mkEnableOption but defaults to true
|
||||
mkDisableOption = option: (lib.mkEnableOption option) // { default = true; example = false; };
|
||||
mkImageOption = { description, url, sha256 ? "" }: lib.mkOption {
|
||||
mkDisableOption =
|
||||
option:
|
||||
(lib.mkEnableOption option)
|
||||
// {
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
mkImageOption =
|
||||
{
|
||||
description,
|
||||
url,
|
||||
sha256 ? "",
|
||||
}:
|
||||
lib.mkOption {
|
||||
inherit description;
|
||||
type = types.path;
|
||||
default = builtins.fetchurl { inherit url sha256; };
|
||||
|
@ -48,9 +60,7 @@ let
|
|||
dev = lib.mkOption {
|
||||
description = lib.mdDoc "Options for setting up a dev environment";
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
options.enable = lib.mkEnableOption "dev configuration";
|
||||
};
|
||||
type = types.submodule { options.enable = lib.mkEnableOption "dev configuration"; };
|
||||
};
|
||||
gui = lib.mkOption {
|
||||
description = lib.mdDoc "Jalil's default configuration for a NixOS gui.";
|
||||
|
@ -77,7 +87,9 @@ let
|
|||
want to allow ssh logins.
|
||||
'';
|
||||
default = { };
|
||||
example = { "jalil-salame" = "sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; };
|
||||
example = {
|
||||
"jalil-salame" = "sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
||||
};
|
||||
type = types.attrsOf types.str;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -13,18 +13,30 @@ in
|
|||
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
||||
polarity = "dark";
|
||||
fonts.monospace = [
|
||||
{ name = "JetBrains Mono"; package = pkgs.jetbrains-mono; }
|
||||
{
|
||||
name = "JetBrains Mono";
|
||||
package = pkgs.jetbrains-mono;
|
||||
}
|
||||
fallbackSymbols
|
||||
];
|
||||
fonts.sansSerif = [
|
||||
{ name = "Noto Sans"; package = pkgs.noto-fonts; }
|
||||
{
|
||||
name = "Noto Sans";
|
||||
package = pkgs.noto-fonts;
|
||||
}
|
||||
fallbackSymbols
|
||||
];
|
||||
fonts.serif = [
|
||||
{ name = "Noto Serif"; package = pkgs.noto-fonts; }
|
||||
{
|
||||
name = "Noto Serif";
|
||||
package = pkgs.noto-fonts;
|
||||
}
|
||||
fallbackSymbols
|
||||
];
|
||||
fonts.emoji = { package = pkgs.noto-fonts-emoji; name = "Noto Color Emoji"; };
|
||||
fonts.emoji = {
|
||||
package = pkgs.noto-fonts-emoji;
|
||||
name = "Noto Color Emoji";
|
||||
};
|
||||
fonts.sizes.popups = 12;
|
||||
targets.plymouth.logoAnimated = false;
|
||||
targets.plymouth.logo = cfg.bootLogo;
|
||||
|
|
Loading…
Reference in a new issue