From 374728c0090e6026c265992ff71e096bd11c2666 Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Wed, 17 Nov 2021 21:26:33 +0200 Subject: [PATCH] keys and git --- flake.nix | 8 ++++++- macbook/masse.nix | 45 ++++++++++++++++++++++++++++++++++++ modules/mac-keys/default.nix | 31 +++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 modules/mac-keys/default.nix diff --git a/flake.nix b/flake.nix index 36f30f6..109a7a1 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,12 @@ outputs = { self, nixpkgs, home-manager, ... } @ inputs: { + nixosModules = + let + dirs = builtins.attrNames (builtins.readDir ./modules); + selfModules = map (module: import (./modules + "/${module}")) dirs; + in + selfModules ++ []; overlays = [ inputs.myEmacs.overlay inputs.myVim.overlay @@ -49,7 +55,7 @@ configuration = {pkgs,...}: { programs.home-manager.enable = true; - imports = [ + imports = self.nixosModules ++ [ ./macbook/masse.nix ]; }; diff --git a/macbook/masse.nix b/macbook/masse.nix index 008ca49..9448d16 100644 --- a/macbook/masse.nix +++ b/macbook/masse.nix @@ -13,4 +13,49 @@ myEmacs myVim ]; + + services.emacs = { + enable = true; + package = pkgs.myEmacs; + }; + + services.flameshot = { + enable = true; + }; + + services.syncthing = { + enable = true; + tray = false; + }; + + programs.mac-keys.enable = true; + programs.git = { + enable = true; + userName = "Mats Rauhala"; + userEmail = "mats.rauhala@iki.fi"; + signing = { + key = "2104943D6033C8F4F7D4F560BDA6DFEDBCFB6779"; + }; + ignores = [ + "env" + "*.swp" + "*.swo" + "*.orig" + "*.crt" + "*.key" + "*.log" + "tags" + "result" + "*.pub" + "*.db" + "*.sqlite" + ".projectile" + ".dir-locals.el" + ]; + extraConfig = { + push = { + default = "simple"; + }; + }; + }; } diff --git a/modules/mac-keys/default.nix b/modules/mac-keys/default.nix new file mode 100644 index 0000000..0e3cd08 --- /dev/null +++ b/modules/mac-keys/default.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ...}: + +with lib; + +let + + cfg = config.programs.mac-keys; + +in + +{ + options.programs.mac-keys = { + enable = mkEnableOption "Mac-Keys"; + }; + + config = lib.mkIf cfg.enable { + home.file.".Xmodmap".text = '' + remove Lock = Caps_Lock + add Lock = Escape + keysym Caps_Lock = Escape + keysym Escape = Caps_Lock + + clear mod4 + + keycode 255 = Tab + keycode 23 = Hyper_L + keycode 134 = ISO_Level3_Shift + keycode 108 = Super_R + ''; + }; +}