refactor local infos

This commit is contained in:
Quentin Boyer 2022-02-06 20:52:31 +01:00
parent 9bdec8d76c
commit 2f1ab8ee88
6 changed files with 251 additions and 130 deletions

27
extra_info.nix Normal file
View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
with lib;
with builtins;
{
options = {
extraInfo.email = mkOption {
type = types.nullOr types.str;
description = "Email address";
default = null;
};
extraInfo.inputs = {
keyboard = mkOption {
type = types.nullOr types.str;
description = "Sway keyboard identifier";
default = null;
};
touchpad = mkOption {
type = types.nullOr types.str;
description = "Sway touchpad identifier";
default = null;
};
};
};
}

280
flake.lock generated
View file

@ -64,6 +64,21 @@
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"locked": {
"lastModified": 1629481132,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
@ -78,6 +93,45 @@
"type": "github"
}
},
"flake-utils_4": {
"locked": {
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"hm-nvim-traxys": {
"inputs": {
"flake-utils": "flake-utils",
"naersk": "naersk",
"nixpkgs": [
"nixpkgs"
],
"nvim-traxys": "nvim-traxys",
"stylua": "stylua"
},
"locked": {
"lastModified": 1644148789,
"narHash": "sha256-roQ97QqsALrCLMvb89isBPlT8poXvsDT+hcpISc07Po=",
"owner": "traxys",
"repo": "home-manager-nvim-flake",
"rev": "fffd731e1493239bd38ffb91181f354ddc97868e",
"type": "github"
},
"original": {
"owner": "traxys",
"repo": "home-manager-nvim-flake",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -100,9 +154,7 @@
},
"naersk": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1639947939,
@ -120,10 +172,7 @@
},
"naersk_2": {
"inputs": {
"nixpkgs": [
"rnix-lsp",
"nixpkgs"
]
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1639947939,
@ -141,20 +190,16 @@
},
"neovim-flake": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nvim-traxys",
"neovim-overlay",
"nixpkgs"
]
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"dir": "contrib",
"lastModified": 1643767869,
"narHash": "sha256-Oyno3HHIKfOdb6Ij6lRxOBp0urPhXBskh/I5l5O5GSM=",
"lastModified": 1643812274,
"narHash": "sha256-CL1TK0bVwU+yDz3Y4enE2pb9Vw+NjzydbOiHbBRoHYs=",
"owner": "neovim",
"repo": "neovim",
"rev": "2559359035b7b0dd6f94fef9573e8133176c1553",
"rev": "21cdecc8e0233d7a99d971327d21f701dbd65ba1",
"type": "github"
},
"original": {
@ -168,18 +213,18 @@
"inputs": {
"flake-compat": "flake-compat",
"neovim-flake": "neovim-flake",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1643789594,
"narHash": "sha256-mxEkC78afrg1KtRhlpdJ5mPLRFFCC+1LcSGpwUYgEBA=",
"owner": "nix-community",
"lastModified": 1644135211,
"narHash": "sha256-/B12MfT5JgY7RkZoTZtDkRydZtkzrjSayXivQqXLfkc=",
"owner": "traxys",
"repo": "neovim-nightly-overlay",
"rev": "d60554a6e96d9ba2da46cd91a4e67c06912f8da4",
"rev": "6c1a6da7f41de436883dc24d860d952ac1521259",
"type": "github"
},
"original": {
"owner": "nix-community",
"owner": "traxys",
"repo": "neovim-nightly-overlay",
"type": "github"
}
@ -202,18 +247,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1643524588,
"narHash": "sha256-Qh5AazxdOQRORbGkkvpKoovDl6ej/4PhDabFsqnueqw=",
"owner": "nixos",
"lastModified": 1643653624,
"narHash": "sha256-+8hLMsQrZ2rkvcEtEId6HMe8GPxVb5ga+Vh1fdsqJDU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "efeefb2af1469a5d1f0ae7ca8f0dfd9bb87d5cfb",
"rev": "a529f0c125a78343b145a8eb2b915b0295e4f459",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs-mozilla": {
@ -233,6 +276,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1643805626,
"narHash": "sha256-AXLDVMG+UaAGsGSpOtQHPIKB+IZ0KSd9WS77aanGzgc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "554d2d8aa25b6e583575459c297ec23750adb6cb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1643524588,
"narHash": "sha256-Qh5AazxdOQRORbGkkvpKoovDl6ej/4PhDabFsqnueqw=",
@ -248,13 +307,73 @@
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1643472818,
"narHash": "sha256-qzVPxKDUubYIxKRSuDl/JgzXWSmGvUVYny9SxFMfPJM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7f65e4abd5ecaad12d2d26e4380d1a7d8edafea7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1643524588,
"narHash": "sha256-Qh5AazxdOQRORbGkkvpKoovDl6ej/4PhDabFsqnueqw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "efeefb2af1469a5d1f0ae7ca8f0dfd9bb87d5cfb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1643653624,
"narHash": "sha256-+8hLMsQrZ2rkvcEtEId6HMe8GPxVb5ga+Vh1fdsqJDU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a529f0c125a78343b145a8eb2b915b0295e4f459",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1643805626,
"narHash": "sha256-AXLDVMG+UaAGsGSpOtQHPIKB+IZ0KSd9WS77aanGzgc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "554d2d8aa25b6e583575459c297ec23750adb6cb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim-traxys": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"neovim-overlay": "neovim-overlay",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs": "nixpkgs_4",
"plugin:cmp-source-buffer": "plugin:cmp-source-buffer",
"plugin:cmp-source-calc": "plugin:cmp-source-calc",
"plugin:cmp-source-crates": "plugin:cmp-source-crates",
@ -289,11 +408,11 @@
"plugin:vim-vsnip": "plugin:vim-vsnip"
},
"locked": {
"lastModified": 1643838764,
"narHash": "sha256-Oa/5irPbFLMbav4YX/sq/8B5MSau3tjEhI3Y89EtA4M=",
"lastModified": 1644139476,
"narHash": "sha256-hh49Dp2CEspGiQCWdz9/fb1MVN/84H2oF6CUCElBX2o=",
"owner": "traxys",
"repo": "nvim-flake",
"rev": "f0c23033a936dcfb6cece1388f74073858c3a489",
"rev": "060ca6d16fcf72407fb6fac47bebca4340d0e68e",
"type": "github"
},
"original": {
@ -673,11 +792,11 @@
"plugin:nvim-treesitter": {
"flake": false,
"locked": {
"lastModified": 1643811536,
"narHash": "sha256-AbLilgMrkzUs/fjshFettSmrdISjBF6nqHVngoynaH8=",
"lastModified": 1643912584,
"narHash": "sha256-HQ9NLHhOQPB6Xcj9G6UqDAWiB0LuDs0iZzRhfyD0XKo=",
"owner": "nvim-treesitter",
"repo": "nvim-treesitter",
"rev": "c9b11ac70c24a3854998c9a92c94759b1d1b52ef",
"rev": "3cfbde4db05dc9f3f38fcee212849799bb6f2e54",
"type": "github"
},
"original": {
@ -830,52 +949,23 @@
"type": "github"
}
},
"rnix-lsp": {
"inputs": {
"naersk": "naersk_2",
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1643586450,
"narHash": "sha256-BRIAc3+zavSlJPYSbov2n1W9/a4Iuh2swFPYRWjCm1g=",
"owner": "nix-community",
"repo": "rnix-lsp",
"rev": "41eb2f3366e3f351bf2563c2a7c46fd17e78dfe0",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "rnix-lsp",
"type": "github"
}
},
"root": {
"inputs": {
"dotacat": "dotacat",
"fast-syntax-highlighting": "fast-syntax-highlighting",
"hm-nvim-traxys": "hm-nvim-traxys",
"home-manager": "home-manager",
"naersk": "naersk",
"nix-zsh-completions": "nix-zsh-completions",
"nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_5",
"nixpkgs-mozilla": "nixpkgs-mozilla",
"nvim-traxys": "nvim-traxys",
"powerlevel10k": "powerlevel10k",
"rnix-lsp": "rnix-lsp",
"stylua": "stylua",
"zsh-nix-shell": "zsh-nix-shell"
"zsh-traxys": "zsh-traxys"
}
},
"stylua": {
"flake": false,
"locked": {
"lastModified": 1643750494,
"narHash": "sha256-LmmOaxB7UNQQUFBYN5wNZYt9xH5wDrBbtB9QOCb3suQ=",
"lastModified": 1644008028,
"narHash": "sha256-DHRR0Egc1NOWCFPsiKx7bCcDTqkVmb7pBbQfTaR71UI=",
"owner": "johnnymorganz",
"repo": "stylua",
"rev": "16c780c5361479aa76cb52a3295a23f777a22004",
"rev": "c9b82ccf6806d925a9eba987508f87a4c306f451",
"type": "github"
},
"original": {
@ -884,21 +974,6 @@
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"zsh-nix-shell": {
"flake": false,
"locked": {
@ -914,6 +989,31 @@
"repo": "zsh-nix-shell",
"type": "github"
}
},
"zsh-traxys": {
"inputs": {
"dotacat": "dotacat",
"fast-syntax-highlighting": "fast-syntax-highlighting",
"flake-utils": "flake-utils_4",
"naersk": "naersk_2",
"nix-zsh-completions": "nix-zsh-completions",
"nixpkgs": "nixpkgs_7",
"powerlevel10k": "powerlevel10k",
"zsh-nix-shell": "zsh-nix-shell"
},
"locked": {
"lastModified": 1644139392,
"narHash": "sha256-q38I072lpuDitKcXTj7sdrJz0fBzC7Fx3/fFc9LpkS4=",
"owner": "traxys",
"repo": "zsh-flake",
"rev": "3335b6a1e36535db16edda71cdfca0b986360949",
"type": "github"
},
"original": {
"owner": "traxys",
"repo": "zsh-flake",
"type": "github"
}
}
},
"root": "root",

View file

@ -40,8 +40,11 @@
home-manager.users.traxys = { config, lib, pkgs, ... }: {
imports = [
./home.nix
./graphical.nix
./extra_info.nix
./localinfo.nix
inputs.zsh-traxys.home-managerModule."${system}"
inputs.hm-nvim-traxys.home-managerModule."${system}"
inputs.hm-nvim-traxys.home-managerModule."${system}"
];
};
# Optionally, use home-manager.extraSpecialArgs to pass

View file

@ -1,8 +1,5 @@
{ pkgs, config, ... }:
let
localinfo = import ./localinfo.nix;
in
{
home.packages = with pkgs; [
bitwarden
@ -36,16 +33,6 @@ in
};
};
/* programs.firefox = {
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
forceWayland = true;
extraPolicies = {
ExtensionSettings = { };
};
};
}; */
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
XDG_CURRENT_DESKTOP = "sway";
@ -139,16 +126,27 @@ in
bars = [{
command = "waybar";
}];
input = {
"${localinfo.keyboard}" = {
xkb_layout = "us";
xkb_variant = "dvp";
xkb_options = "compose:102";
};
"${localinfo.touchpad}" = {
dwt = "disable";
};
};
input =
let
inputs = config.extraInfo.inputs;
inputsCfg = [
(if inputs.keyboard != null then {
name = inputs.keyboard;
value =
{
xkb_layout = "us";
xkb_variant = "dvp";
xkb_options = "compose:102";
};
} else null)
(if inputs.touchpad != null then {
name = inputs.touchpad;
value = { dwt = "disable"; };
} else null)
];
in
builtins.listToAttrs inputsCfg;
fonts = {
names = [ "Hack Nerd Font" ];
style = "Regular";

View file

@ -10,17 +10,8 @@ let
cargo = rustVersion;
rustc = rustVersion;
};
localinfo = import ./localinfo.nix;
in
{
imports = [
./graphical.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = localinfo.username;
home.homeDirectory = localinfo.homeDir;
home.sessionVariables = {
RUSTC_WRAPPER = "${pkgs.sccache}/bin/sccache";
};
@ -76,7 +67,7 @@ in
git = {
enable = true;
userName = "Quentin Boyer";
userEmail = localinfo.email;
userEmail = config.extraInfo.email;
delta = {
enable = true;
options = {
@ -91,7 +82,7 @@ in
algorithm = "histogram";
};
core = {
excludesfile = "${localinfo.homeDir}/.gitignore";
excludesfile = "${config.home.homeDirectory}/.gitignore";
};
};
};

View file

@ -1,9 +1,11 @@
{
username = "string";
homeDir = "path";
home.username = "traxys";
home.homeDirectory = "/home/traxys";
email = "email";
extraInfo.email = "some@email";
keyboard = "null or libinput id";
touchpad = "null or libinput id";
extraInfo.inputs = {
keyboard = "1:1:AT_Translated_Set_2_keyboard";
touchpad = "2:7:SynPS/2_Synaptics_TouchPad";
};
}