getting started with HM

This commit is contained in:
Grimmauld 2024-12-23 12:18:12 +01:00
parent 9f2621b6be
commit d1997df806
Signed by: Grimmauld
SSH key fingerprint: SHA256:Q8IL6Y7sSKqzkyFdV1L0O/EflEh1fFV3tBtwxpapRH4
12 changed files with 205 additions and 48 deletions

View file

@ -20,7 +20,8 @@ in
environment.pathsToLink = [ "/share/soundfonts" ]; environment.pathsToLink = [ "/share/soundfonts" ];
environment.etc."timidity/timidity.cfg".text = "soundfont ${sound_font}/share/soundfonts/FluidR3_GM2-2.sf2"; environment.etc."timidity/timidity.cfg".text =
"soundfont ${sound_font}/share/soundfonts/FluidR3_GM2-2.sf2";
}; };
options.grimmShared.sound.midi = lib.mkEnableOption "enable midi"; options.grimmShared.sound.midi = lib.mkEnableOption "enable midi";

View file

@ -15,7 +15,6 @@ in
security.apparmor.enableCache = true; security.apparmor.enableCache = true;
environment.systemPackages = with pkgs; [ apparmor-parser ]; environment.systemPackages = with pkgs; [ apparmor-parser ];
# security.apparmor.aa-alias-manager.enable = false; # security.apparmor.aa-alias-manager.enable = false;

View file

@ -21,7 +21,7 @@ in
pkgs.jdk17 pkgs.jdk17
pkgs.visualvm pkgs.visualvm
pkgs.gradle_7 pkgs.gradle_7
] ++ optionals graphical [ pkgs.jetbrains.idea-community ]; ]; # ++ optionals graphical [ pkgs.jetbrains.idea-community ];
environment.sessionVariables.JAVA_HOME = pkgs.jdk17.home; environment.sessionVariables.JAVA_HOME = pkgs.jdk17.home;

View file

@ -31,7 +31,7 @@ in
config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) { config = mkIf (enable && tooling.enable && (elem lang_support_id tooling.supportedLangs)) {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.python3.withPackages pyLibs) (pkgs.python3.withPackages pyLibs)
] ++ lib.optionals graphical (with pkgs; [ jetbrains.pycharm-community ]); ]; # ++ lib.optionals graphical (with pkgs; [ jetbrains.pycharm-community ]);
programs.xonsh = { programs.xonsh = {
enable = true; enable = true;

73
dual_monitor_otd.json Normal file
View file

@ -0,0 +1,73 @@
{
"Profiles": [
{
"Tablet": "Wacom PTH-660",
"OutputMode": {
"Path": "OpenTabletDriver.Desktop.Output.AbsoluteMode",
"Settings": [],
"Enable": true
},
"Filters": [],
"AbsoluteModeSettings": {
"Display": {
"Width": 3840.0,
"Height": 1080.0,
"X": 1920.0,
"Y": 540.0,
"Rotation": 0.0
},
"Tablet": {
"Width": 148.0,
"Height": 42.0,
"X": 112.0,
"Y": 74.0,
"Rotation": 90.0
},
"EnableClipping": true,
"EnableAreaLimiting": false,
"LockAspectRatio": false
},
"RelativeModeSettings": {
"XSensitivity": 10.0,
"YSensitivity": 10.0,
"RelativeRotation": 0.0,
"RelativeResetDelay": "00:00:00.1000000"
},
"Bindings": {
"TipActivationThreshold": 0.0,
"TipButton": {
"Path": "OpenTabletDriver.Desktop.Binding.MouseBinding",
"Settings": [
{
"Property": "Button",
"Value": "Left"
}
],
"Enable": true
},
"EraserActivationThreshold": 0.0,
"EraserButton": null,
"PenButtons": [
null,
null
],
"AuxButtons": [
null,
null,
null,
null,
null,
null,
null,
null
],
"MouseButtons": [],
"MouseScrollUp": null,
"MouseScrollDown": null
}
}
],
"LockUsableAreaDisplay": true,
"LockUsableAreaTablet": true,
"Tools": []
}

77
flake.lock generated
View file

@ -101,11 +101,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734558035, "lastModified": 1734881868,
"narHash": "sha256-v45bzSPoI7q/mGeP0YyBaE5F/fFuQ75GPHRGTPNpcsw=", "narHash": "sha256-ONpu806E6j/23ZCgvfAR7bNusDjC5bVThTOjNkUMIqQ=",
"owner": "LordGrimmauld", "owner": "LordGrimmauld",
"repo": "apparmor-dev", "repo": "apparmor-dev",
"rev": "d9d7d629c902a10e1c9986efb8b79c7d9daf02ed", "rev": "032cb3469176411d5bda5642049abc468073e18a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -140,11 +140,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734346739, "lastModified": 1734915121,
"narHash": "sha256-Um5yY36idRodddotyBaI9sQjw/xw5SV6tt3jPRgL330=", "narHash": "sha256-iSEzSBeGwNmg/F95taw9POJiWq4iEZ2VGcOaBUabCtc=",
"owner": "chaotic-cx", "owner": "chaotic-cx",
"repo": "nyx", "repo": "nyx",
"rev": "7228d7032f0316dbc69b69584ec07707efbd38c9", "rev": "914e86e0d0c1ce969bd4c4184cfd2188ee51b891",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -342,11 +342,31 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734093295, "lastModified": 1734622215,
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=", "narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8", "rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_3": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1734942126,
"narHash": "sha256-4543MvF57F6lpQYaC0+TkVVgLJvEsIr7LlYdOKYAXnk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8bea1a2005c64a8c9c430d0dddb6b2e5db5f6f12",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -364,11 +384,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734162608, "lastModified": 1734725857,
"narHash": "sha256-m2AX+3eiVqIK6uO7GbGY7SFnkkYOlR5fQiNI0eRvWOQ=", "narHash": "sha256-bivlV9l/UjMtTfz/CZaoNJ5RfH2Lre4P9Ds64conoUQ=",
"owner": "Jovian-Experiments", "owner": "Jovian-Experiments",
"repo": "Jovian-NixOS", "repo": "Jovian-NixOS",
"rev": "31bdf4c7c91204d65afbde01146deee0259a8fb7", "rev": "dbae2fd6adaf34c947d310bec08deac7c4ed265b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -471,14 +491,14 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-24_05": "nixpkgs-24_05" "nixpkgs-24_11": "nixpkgs-24_11"
}, },
"locked": { "locked": {
"lastModified": 1734370678, "lastModified": 1734884447,
"narHash": "sha256-a8zkti1QM5Oxkdfnzr/NjrFlyqI36/kYV/X8G1jOmB4=", "narHash": "sha256-HA9fAmGNGf0cOYrhgoa+B6BxNVqGAYXfLyx8zIS0ZBY=",
"owner": "simple-nixos-mailserver", "owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver", "repo": "nixos-mailserver",
"rev": "c43d8c4a3ce84a7bebd110b06e69365484db6208", "rev": "63209b1def2c9fc891ad271f474a3464a5833294",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -510,32 +530,32 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1734536697, "lastModified": 1734649271,
"narHash": "sha256-G/HnRTtU+ob8x967kjzMRqjNFbAdllrcjYc+IcaR15Y=", "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9c40bef08a5bdc0ccc3207f4282a1ded83e77a7a", "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable-small", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-24_05": { "nixpkgs-24_11": {
"locked": { "locked": {
"lastModified": 1731797254, "lastModified": 1734083684,
"narHash": "sha256-df3dJApLPhd11AlueuoN0Q4fHo/hagP75LlM5K1sz9g=", "narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "e8c38b73aeb218e27163376a2d617e61a2ad9b59", "rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-24.05", "ref": "nixos-24.11",
"type": "indirect" "type": "indirect"
} }
}, },
@ -563,11 +583,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1734260421, "lastModified": 1734559477,
"narHash": "sha256-vsr+9xKkirwEjvXTS2sOVIxlKQmF/QjszD+Ph0/oRgc=", "narHash": "sha256-Jwvow0ri+ZgCdP6jpNQVjxub14Pxs1kyjvDV3BbvNzE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-update", "repo": "nixpkgs-update",
"rev": "712e24bd6543801c52f6c0656a8371f8d029030e", "rev": "7f089591e8f595011323c8a7370b195fa3dfe0b7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -621,6 +641,7 @@
"agenix": "agenix", "agenix": "agenix",
"apparmor-dev": "apparmor-dev", "apparmor-dev": "apparmor-dev",
"chaotic": "chaotic", "chaotic": "chaotic",
"home-manager": "home-manager_3",
"nixos-mailserver": "nixos-mailserver", "nixos-mailserver": "nixos-mailserver",
"nixos-matrix-modules": "nixos-matrix-modules", "nixos-matrix-modules": "nixos-matrix-modules",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",

View file

@ -3,7 +3,7 @@
inputs = { inputs = {
nixpkgs = { nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable-small"; url = "github:NixOS/nixpkgs/nixos-unstable";
# url = "git+file:///home/grimmauld/coding/nixpkgs"; # url = "git+file:///home/grimmauld/coding/nixpkgs";
}; };
chaotic = { chaotic = {
@ -40,6 +40,8 @@
url = "github:LordGrimmauld/apparmor-dev"; url = "github:LordGrimmauld/apparmor-dev";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = outputs =
@ -54,6 +56,7 @@
aa-alias-manager, aa-alias-manager,
nixpkgs-update, nixpkgs-update,
apparmor-dev, apparmor-dev,
home-manager,
... ...
}: }:
let let
@ -73,7 +76,8 @@
src = inputs.nixpkgs; src = inputs.nixpkgs;
patches = map (p: if (builtins.isPath p) then p else (unpatched.fetchpatch p)) patches; patches = map (p: if (builtins.isPath p) then p else (unpatched.fetchpatch p)) patches;
}; };
nixosSystem = if patches == [] then nixpkgs.lib.nixosSystem else import (patched + "/nixos/lib/eval-config.nix"); nixosSystem =
if patches == [ ] then nixpkgs.lib.nixosSystem else import (patched + "/nixos/lib/eval-config.nix");
in in
nixosSystem ( nixosSystem (
{ {
@ -116,6 +120,9 @@
# apparmor-dev.nixosModules.default # apparmor-dev.nixosModules.default
./specific/grimm-nixos-ssd/configuration.nix ./specific/grimm-nixos-ssd/configuration.nix
home-manager.nixosModules.home-manager
./hm
]; ];
}; };
grimmauld-nixos-server = customNixosSystem "x86_64-linux" { grimmauld-nixos-server = customNixosSystem "x86_64-linux" {

5
hm/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
imports = [ ./grimmauld ];
}

2
hm/gradle.properties Normal file
View file

@ -0,0 +1,2 @@
org.gradle.java.home=/nix/store/1fylwjqscywqb5xxsi258h0ka3pz4ax6-openjdk-17.0.11+9/lib/openjdk
org.gradle.java.installations.auto-detect=false

47
hm/grimmauld/default.nix Normal file
View file

@ -0,0 +1,47 @@
{
pkgs,
lib,
config ? {},
...
}:
let
getIfHas = path: attrs: if path == [] then
attrs
else if builtins.hasAttr (builtins.head path) attrs then
getIfHas (builtins.tail path) (builtins.getAttr (builtins.head path) attrs)
else
null;
user = hm_config.home.username;
homedir = hm_config.home.homeDirectory;
hm_config = {
home = {
username = "grimmauld";
stateVersion = "24.11";
homeDirectory = "/home/${user}";
};
systemd.user.enable = true;
systemd.user.tmpfiles.rules = lib.optional (lib.defaultTo false (getIfHas ["services" "printing" "cups-pdf" "enable"] config)) "L ${homedir}/PDF - - - - /var/spool/cups-pdf-pdf/users/${user}";
xdg.userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
"3d" = "${homedir}/3d";
};
};
programs.gradle = {
enable = true;
settings = {
"org.gradle.java.home" = "${pkgs.openjdk}/lib/openjdk";
"org.gradle.java.installations.auto-detect" = false;
};
};
};
in
{
home-manager.users."${user}" = hm_config;
}

View file

@ -35,7 +35,8 @@ in
port = ports.redis_nextcloud_port.port; port = ports.redis_nextcloud_port.port;
}; };
systemd.services.nextcloud-setup.serviceConfig.ExecStartPost = pkgs.writeScript "nextcloud-redis.sh" '' systemd.services.nextcloud-setup.serviceConfig.ExecStartPost =
pkgs.writeScript "nextcloud-redis.sh" ''
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}
nextcloud-occ config:system:set redis 'host' --value '::1' --type string nextcloud-occ config:system:set redis 'host' --value '::1' --type string
nextcloud-occ config:system:set redis '${builtins.toString config.services.redis.servers.nextcloud.port}' --value 6379 --type integer nextcloud-occ config:system:set redis '${builtins.toString config.services.redis.servers.nextcloud.port}' --value 6379 --type integer

View file

@ -65,7 +65,8 @@
"$mod+Return" = "exec ${getExe xdg-terminal-exec}"; "$mod+Return" = "exec ${getExe xdg-terminal-exec}";
"$mod+Shift+q" = "kill"; "$mod+Shift+q" = "kill";
"$mod+Shift+c" = "reload"; "$mod+Shift+c" = "reload";
"$mod+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'"; "$mod+Shift+e" =
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'";
# Move your focus around # Move your focus around
"$mod+$left" = "focus left"; "$mod+$left" = "focus left";