commit 016c36f4589a6a41a1d77d7bff019d4509c14626
parent 160600b5f6153b156b87cf8e830d9713ea245ec9
Author: Anders Hedman <anders.hedman01gmail.com>
Date: Tue, 22 Oct 2024 22:06:35 +0200
hm: Add flake and split config
Diffstat:
4 files changed, 153 insertions(+), 42 deletions(-)
diff --git a/.config/home-manager/flake.lock b/.config/home-manager/flake.lock
@@ -0,0 +1,49 @@
+{
+ "nodes": {
+ "home-manager": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1726989464,
+ "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
+ "owner": "nix-community",
+ "repo": "home-manager",
+ "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "ref": "release-24.05",
+ "repo": "home-manager",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1729449015,
+ "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "89172919243df199fe237ba0f776c3e3e3d72367",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-24.05",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "home-manager": "home-manager",
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/.config/home-manager/flake.nix b/.config/home-manager/flake.nix
@@ -5,25 +5,39 @@
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
home-manager = {
- url = "github:nix-community/home-manager";
+ url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
- outputs = { nixpkgs, home-manager, ... }:
+ outputs =
+ { nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
- in {
- homeConfigurations."anders" = home-manager.lib.homeManagerConfiguration {
+ user = "anders";
+ homedir = "/home/${user}";
+ dotdir = ../..;
+
+ in
+ {
+ homeConfigurations."anders@t480s" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
- modules = [ ./home.nix ];
+ modules = [
+ ./home.nix
+ ./t480s.nix
+ ];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
+ extraSpecialArgs = {
+ inherit user;
+ inherit homedir;
+ inherit dotdir;
+ };
};
};
}
diff --git a/.config/home-manager/home.nix b/.config/home-manager/home.nix
@@ -1,12 +1,11 @@
-{ config, pkgs, ... }:
-
-let
-
- user = "anders";
- homedir = "/home/${user}";
- dotdir = "${homedir}/Repos/dotfiles";
-
-in
+{
+ config,
+ pkgs,
+ user,
+ homedir,
+ dotdir,
+ ...
+}:
{
# Home Manager needs a bit of information about you and the paths it should
@@ -16,7 +15,7 @@ in
programs.git = {
enable = true;
- userName = "Anders Hedman";
+ userName = "Anders Hedman";
userEmail = "anders.hedman01gmail.com";
};
@@ -31,7 +30,7 @@ in
# The home.packages option allows you to install Nix packages into your
# environment.
- home.packages = [
+ home.packages = with pkgs; [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
@@ -48,6 +47,8 @@ in
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
+ nixfmt-rfc-style
+ nil
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
@@ -87,33 +88,53 @@ in
};
dconf.settings = {
- "org/gnome/desktop/background" = {
- picture-uri = "file:///${homedir}/Repos/dotfiles/Wallpapers/nix1.png";
- picture-uri-dark = "file:///${homedir}/Repos/dotfiles/Wallpapers/nix1.png";
- };
"org/gnome/desktop/interface" = {
clock-show-weekday = true;
color-scheme = "prefer-dark";
};
"org/gnome/desktop/input-sources" = {
- xkb-options = ["caps:escape"];
+ xkb-options = [ "caps:escape" ];
};
"org/gnome/desktop/wm/keybindings" = {
- activate-window-menu = ["Menu"];
- switch-applications = ["<Super>Tab"];
- switch-applications-backward = ["<Shift><Super>Tab"];
- close = ["<Super>w"];
- minimize = ["<Shift><Alt>h"];
- move-to-workspace-1 = ["<Shift><Super>h" "<Shift><Super>Home"];
- move-to-workspace-last = ["<Shift><Super>l" "<Shift><Super>End"];
- move-to-workspace-left = ["<Shift><Super>j" "<Shift><Super>Page_Up"];
- move-to-workspace-right = ["<Shift><Super>k" "<Shift><Super>Page_Down"];
- switch-to-workspace-1 = ["<Super>h" "<Super>Home"];
- switch-to-workspace-last = ["<Super>l" "<Super>End"];
- switch-to-workspace-left = ["<Super>j" "<Super>Page_Up"];
- switch-to-workspace-right = ["<Super>k" "<Super>Page_Down"];
- switch-windows = ["<Alt>Tab"];
- switch-windows-backward = ["<Shift><Alt>Tab"];
+ activate-window-menu = [ "Menu" ];
+ switch-applications = [ "<Super>Tab" ];
+ switch-applications-backward = [ "<Shift><Super>Tab" ];
+ close = [ "<Super>w" ];
+ minimize = [ "<Shift><Alt>h" ];
+ move-to-workspace-1 = [
+ "<Shift><Super>h"
+ "<Shift><Super>Home"
+ ];
+ move-to-workspace-last = [
+ "<Shift><Super>l"
+ "<Shift><Super>End"
+ ];
+ move-to-workspace-left = [
+ "<Shift><Super>j"
+ "<Shift><Super>Page_Up"
+ ];
+ move-to-workspace-right = [
+ "<Shift><Super>k"
+ "<Shift><Super>Page_Down"
+ ];
+ switch-to-workspace-1 = [
+ "<Super>h"
+ "<Super>Home"
+ ];
+ switch-to-workspace-last = [
+ "<Super>l"
+ "<Super>End"
+ ];
+ switch-to-workspace-left = [
+ "<Super>j"
+ "<Super>Page_Up"
+ ];
+ switch-to-workspace-right = [
+ "<Super>k"
+ "<Super>Page_Down"
+ ];
+ switch-windows = [ "<Alt>Tab" ];
+ switch-windows-backward = [ "<Shift><Alt>Tab" ];
};
"org/gnome/desktop/wm/preferences" = {
button-layout = "appmenu:minimize,maximize,close";
@@ -121,17 +142,12 @@ in
#focus-new-window = "smart";
};
"org/gnome/settings-daemon/plugins/media-keys" = {
- screensaver = ["<Shift><Alt>l"];
+ screensaver = [ "<Shift><Alt>l" ];
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
];
};
- "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
- binding = "<Super>Return";
- command = "kgx";
- name = "Launch Terminal";
- };
"org/gnome/shell/window-switcher" = {
current-workspace-only = false;
};
diff --git a/.config/home-manager/t480s.nix b/.config/home-manager/t480s.nix
@@ -0,0 +1,32 @@
+{
+ config,
+ pkgs,
+ homedir,
+ ...
+}:
+
+{
+
+ home.packages = with pkgs; [
+ nodejs_22
+ pandoc
+ shellcheck
+ ];
+
+ home.file = { };
+
+ home.sessionVariables = { };
+
+ dconf.settings = {
+ "org/gnome/desktop/background" = {
+ picture-uri = "file:///${homedir}/Repos/dotfiles/Wallpapers/nix1.png";
+ picture-uri-dark = "file:///${homedir}/Repos/dotfiles/Wallpapers/nix1.png";
+ };
+ "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
+ binding = "<Super>Return";
+ command = "kgx";
+ name = "Launch Terminal";
+ };
+ };
+
+}