Compare commits

...

13 Commits

10 changed files with 465 additions and 14 deletions

View File

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1751313918,
"narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=",
"lastModified": 1755825449,
"narHash": "sha256-XkiN4NM9Xdy59h69Pc+Vg4PxkSm9EWl6u7k6D5FZ5cM=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf",
"rev": "8df64f819698c1fee0c2969696f54a843b2231e8",
"type": "github"
},
"original": {
@ -45,11 +45,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1754925269,
"narHash": "sha256-jQ9T5PFxb+5CcFoe3tCVZATv+kSHgn3uxg1CaFp99VU=",
"lastModified": 1756046222,
"narHash": "sha256-Tt21rG+ee4PrJe85YF36rgmVDIpgh3HjRf2JCtVET/c=",
"owner": "larstvei",
"repo": "emacs-flake",
"rev": "89b8619b12bbd876b1958403c8afb22cfec6474e",
"rev": "8e643d23c2804f2a8883adba40dcd238e527bfa8",
"type": "github"
},
"original": {
@ -118,11 +118,32 @@
]
},
"locked": {
"lastModified": 1754924470,
"narHash": "sha256-asI/or9AcUMydwzodCgpHGytnMSNUlciw3uaycpXm4E=",
"lastModified": 1756022458,
"narHash": "sha256-J1i35r4HfNDdPpwL0vOBaZopQudAUVtartEerc1Jryc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "67393957c27b4e4c6c48a60108a201413ced7800",
"rev": "9e3a33c0bcbc25619e540b9dfea372282f8a9740",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"zen-browser",
"nixpkgs"
]
},
"locked": {
"lastModified": 1752603129,
"narHash": "sha256-S+wmHhwNQ5Ru689L2Gu8n1OD6s9eU9n9mD827JNR+kw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e8c19a3cec2814c754f031ab3ae7316b64da085b",
"type": "github"
},
"original": {
@ -239,11 +260,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1754800730,
"narHash": "sha256-HfVZCXic9XLBgybP0318ym3cDnGwBs/+H5MgxFVYF4I=",
"lastModified": 1755829505,
"narHash": "sha256-4/Jd+LkQ2ssw8luQVkqVs9spDBVE6h/u/hC/tzngsPo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "641d909c4a7538f1539da9240dedb1755c907e40",
"rev": "f937f8ecd1c70efd7e9f90ba13dfb400cf559de4",
"type": "github"
},
"original": {
@ -259,7 +280,8 @@
"emacs-larstvei": "emacs-larstvei",
"home-manager": "home-manager",
"nix-rosetta-builder": "nix-rosetta-builder",
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_3",
"zen-browser": "zen-browser"
}
},
"systems": {
@ -276,6 +298,27 @@
"repo": "default",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"home-manager": "home-manager_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1756009581,
"narHash": "sha256-2I/NyYJm6Zq6fJ1YQWSY1S77LjXw+woFYUYEwU91uCc=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "0f80eb175059149c59edde75202721cab3384464",
"type": "github"
},
"original": {
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"type": "github"
}
}
},
"root": "root",

View File

@ -17,15 +17,21 @@
url = "github:cpick/nix-rosetta-builder";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-larstvei.url = "github:larstvei/emacs-flake";
};
outputs =
{
darwin,
nixpkgs,
home-manager,
nix-rosetta-builder,
emacs-larstvei,
zen-browser,
...
}:
{
@ -43,5 +49,17 @@
];
};
};
nixosConfigurations.thinkpad = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit emacs-larstvei;
inherit zen-browser;
};
modules = [
home-manager.nixosModules.default
./hosts/thinkpad/configuration.nix
];
};
};
}

27
home/desktop/default.nix Normal file
View File

@ -0,0 +1,27 @@
{ zen-browser, ... }:
{
imports = [
zen-browser.homeModules.beta
./hypr
];
programs.zen-browser = {
enable = true;
policies = {
DisableAppUpdate = true;
DisableTelemetry = true;
AutofillAddressesEnabled = false;
AutoFillCreditCardEnabled = false;
DisablePocket = true;
DisableProfileImport = true;
DisableSetDesktopBackground = true;
DontCheckDefaultBrowser = true;
HomepageURL = "https://start.hadi.diy";
StartPage = "homepage";
NewTabPage = true;
OfferToSaveLogins = false;
# find more options here: https://mozilla.github.io/policy-templates/
};
};
}

View File

@ -0,0 +1,72 @@
{ pkgs, ... }:
{
home.packages = [
pkgs.rofi-wayland
pkgs.brightnessctl
];
programs.kitty.enable = true;
wayland.windowManager.hyprland = {
enable = true;
settings = {
monitor = [ ",preferred,auto,1.2" ];
xwayland.force_zero_scaling = true;
gestures.workspace_swipe = true;
input = {
kb_options = "altwin:swap_alt_win";
repeat_delay = 225;
repeat_rate = 50;
touchpad = {
natural_scroll = true;
scroll_factor = 0.4;
tap-to-click = true;
};
};
"$mod" = "SUPER";
"$shiftMod" = "SUPER_SHIFT";
bind = [
"$mod, RETURN, exec, kitty"
"$mod, E, exec, emacsclient -c"
"$mod, Q, killactive"
"$mod, SPACE, exec, rofi -show drun"
"$mod, F, fullscreen"
"$mod, H, movefocus, l"
"$mod, J, movefocus, d"
"$mod, K, movefocus, u"
"$mod, L, movefocus, r"
"$shiftMod, H, movewindow, l"
"$shiftMod, J, movewindow, d"
"$shiftMod, K, movewindow, u"
"$shiftMod, L, movewindow, r"
", XF86MonBrightnessUp, exec, brightnessctl set +5%"
", XF86MonBrightnessDown, exec, brightnessctl set 5%-"
]
++ builtins.concatLists (
builtins.genList (
i:
let
code = "1${toString i}";
ws = toString (i + 1);
in
[
"$mod, code:${code}, workspace, ${ws}"
"$shiftMod, code:${code}, movetoworkspace, ${ws}"
]
) 9
);
};
};
}

View File

@ -18,7 +18,9 @@ with pkgs;
];
spelling = [
(hunspellWithDicts [ hunspellDicts.nb_NO ])
hunspell
hunspellDicts.en_US
hunspellDicts.nb_NO
];
# terminal = [

View File

@ -0,0 +1,149 @@
{
pkgs,
emacs-larstvei,
zen-browser,
...
}:
let
v = import ./variables.nix;
in
{
imports = [
../../system
../../system/nixos
./keyboard.nix
./hardware-configuration.nix
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit emacs-larstvei;
inherit zen-browser;
};
users.${v.username}.imports = [
../../home
../../home/desktop
];
};
users.users.${v.username} = {
isNormalUser = true;
description = "Lars Tveito";
home = v.userHome;
shell = pkgs.fish;
extraGroups = [
"networkmanager"
"wheel"
];
};
networking.hostName = v.hostName;
# Everything below is part of the default configuration.
# Keep your user—just point to variables if you want
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Oslo";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "no";
variant = "";
};
# Configure console keymap
console.keyMap = "no";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Enable automatic login for the user.
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "larstvei";
# Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
# Install firefox.
programs.firefox.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment?
}

View File

@ -0,0 +1,56 @@
# 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,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/731c3f4a-8d5a-4329-adf8-78cae3946f58";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/7B4D-CA7D";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/35e15cf2-4657-4fc4-9bbd-9911031baa53"; }
];
# 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
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -0,0 +1,60 @@
{
services.kanata = {
enable = true;
keyboards = {
internalKeyboard = {
devices = [
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
];
extraDefCfg = "process-unmapped-keys yes";
config = ''
(defvar
tap-time 150
hold-time 200
)
(defsrc
e r
caps a s d f g h j k l ;
c v
)
(defalias
;; home-row mods
caps (tap-hold $tap-time $hold-time bspc lctl)
a (tap-hold $tap-time $hold-time a lsft)
s (tap-hold $tap-time $hold-time s lalt)
d (tap-hold $tap-time $hold-time d lmet)
f (tap-hold $tap-time $hold-time f lctl)
j (tap-hold $tap-time $hold-time j rctl)
k (tap-hold $tap-time $hold-time k rmet)
l (tap-hold $tap-time $hold-time l ralt)
; (tap-hold $tap-time $hold-time ; rsft)
;; layer-taps
g (tap-hold $tap-time $hold-time g (layer-while-held navigation))
h (tap-hold $tap-time $hold-time h (layer-while-held symbol))
)
(deflayer base
e r
@caps @a @s @d @f @g @h @j @k @l @;
c v
)
(deflayer navigation
e r
@caps @a @s @d @f @g left down up right @;
c v
)
(deflayer symbol
S-[ S-]
@caps @a S-4 S-9 S-0 @g @h @j @k @l @;
[ ]
)
'';
};
};
};
}

View File

@ -0,0 +1,5 @@
{
username = "larstvei";
userHome = "/home/larstvei";
hostName = "larstvei-think";
}

19
system/nixos/default.nix Normal file
View File

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
fonts.packages = import ../../home/fonts { inherit pkgs; };
programs.fish.enable = true;
environment.shells = [ pkgs.fish ];
nixpkgs.config.allowUnfree = true;
programs._1password.enable = true;
programs._1password-gui.enable = true;
programs.hyprland = {
enable = true;
withUWSM = true;
package = pkgs.hyprland;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
};
}