commit 2bd9025c69e7f672c13e0a6bfe15e326e50a8143 Author: Thea Schöbl Date: Sat Oct 28 13:24:52 2023 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..dc81a6f --- /dev/null +++ b/flake.lock @@ -0,0 +1,175 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1698479159, + "narHash": "sha256-rJHBDwW4LbADEfhkgGHjKGfL2dF44NrlyXdXeZrQahs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "f92a54fef4eacdbe86b0a2054054dd58b0e2a2a4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "nixpkgs": "nixpkgs", + "systems": "systems", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1698407117, + "narHash": "sha256-3X8R+N43YscAEbx+IrhaGNfM3yK+uxjTGuLv9VB82NY=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "4a4e13f8acedd2dc44236deed13fd47096cbe508", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1698134075, + "narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1698318101, + "narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "63678e9f3d3afecfeafa0acead6239cdb447574c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "hyprland": "hyprland", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1697909146, + "narHash": "sha256-jU0I6FoCKnj4zIBL4daosFWh81U1fM719Z6cae8PxSY=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "47bf87ade2bd32395615a385ebde1fefbcdf79a2", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "rev": "47bf87ade2bd32395615a385ebde1fefbcdf79a2", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1697981233, + "narHash": "sha256-y8q4XUwx+gVK7i2eLjfR32lVo7TYvEslyzrmzYEaPZU=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "22e7a65ff9633e1dedfa5317fdffc49f68de2ff2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..226ca74 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + hyprland.url = "github:hyprwm/Hyprland"; + }; + + outputs = {nixpkgs, home-manager, hyprland, ...}: + let + username = "theaninova"; + system = "x86_64-linux"; + stateVersion = "23.11"; + + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + + homeDirPrefix = if pkgs.stdenv.hostPlatform.isDarwin then "/Users" else "/home"; + homeDirectory = "/${homeDirPrefix}/${username}"; + + home = (import ./home.nix { + inherit homeDirectory pkgs stateVersion system username; + }); + in { + homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + modules = [ + hyprland.homeManagerModules.default + home + ]; + }; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..9ead097 --- /dev/null +++ b/home.nix @@ -0,0 +1,24 @@ +{ homeDirectory, pkgs, stateVersion, system, username }: +let + packages = import ./packages.nix { inherit pkgs; }; +in { + home = { + inherit homeDirectory packages stateVersion username; + + shellAliases = { + reload-home-manager-config = "home-manager switch --flake ${builtins.toString ./.}"; + }; + }; + + nixpkgs = { + config = { + inherit system; + allowUnfree = true; + allowUnsupportedSystem = true; + experimental-features = "nix-command flakes"; + }; + }; + + programs = import ./programs.nix { inherit pkgs; }; + services = import ./services.nix; +} diff --git a/hyprland.nix b/hyprland.nix new file mode 100644 index 0000000..4a59b28 --- /dev/null +++ b/hyprland.nix @@ -0,0 +1,49 @@ +{ + inputs = { + hyprland.url = "github:hyprwm/Hyprland"; + split-monitor-workspaces = { + url = "github:Duckonaut/split-monitor-workspaces"; + inputs.hyprland.follows = "hyprland"; + }; + }; + + outputs = { + imports = [ hyprland.homeManagerModules.default ]; + wayland.windowManager.hyprland { + enabled = true; + extraConfig = '' + # window layout + monitor=DP-1,1920x1080@240,0x0,1,vrr,1 + monitor=DP-3:2560x1440@75,1920x0,1,vrr,1 + monitor=HDMI-1:1920x1080@75,0x1080,1,transform,2 + + # workspaces + workspace=1,monitor:DP-1,persistent:true + workspace=2,monitor:DP-1,persistent:true + workspace=3,monitor:DP-1,persistent:true + workspace=4,monitor:DP-3,persistent:true + workspace=5,monitor:DP-3,persistent:true + workspace=6,monitor:DP-3,persistent:true + workspace=7,monitor:HDMI-1,persistent:true + workspace=8,monitor:HDMI-1,persistent:true + workspace=9,monitor:HDMI-1,persistent:true + + # window rules + windowrule=pseudo,^(alacritty)$ + + # Keybinds + $mod = SUPER + + ## base + bind=$mod,Q,killactive + + ## programs + bind=$mod,T,exec,alacritty + ''; + }; + + programs = { + alacritty.enabled = true; + }; +} + diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..5bfdc9f --- /dev/null +++ b/packages.nix @@ -0,0 +1,8 @@ +{ pkgs }: + +let + nixTools = with pkgs; [ + cachix + lorri + ]; +in nixTools diff --git a/programs.nix b/programs.nix new file mode 100644 index 0000000..290e756 --- /dev/null +++ b/programs.nix @@ -0,0 +1,7 @@ +{ pkgs }: +{ + home-manager.enable = true; + zsh = import ./programs/zsh.nix { inherit pkgs; }; + rbw = import ./programs/bitwarden.nix; + git = import ./programs/git.nix; +} diff --git a/programs/bitwarden.nix b/programs/bitwarden.nix new file mode 100644 index 0000000..ad9ffae --- /dev/null +++ b/programs/bitwarden.nix @@ -0,0 +1,8 @@ +{ + enable = true; + settings = { + base_url = "pw.theaninova.de"; + email = "pw@theaninova.de"; + pinentry = "gnome3"; + }; +} diff --git a/programs/git.nix b/programs/git.nix new file mode 100644 index 0000000..6379d78 --- /dev/null +++ b/programs/git.nix @@ -0,0 +1,9 @@ +{ + enable = true; + userName = "Thea Schöbl"; + userEmail = "dev@theaninova.de"; + signing = { + key = "6C9E EFC5 1AE0 0131 78DE B9C8 68FF FB1E C187 88CA"; + signByDefault = true; + }; +} diff --git a/programs/zsh.nix b/programs/zsh.nix new file mode 100644 index 0000000..a2c86c7 --- /dev/null +++ b/programs/zsh.nix @@ -0,0 +1,38 @@ +{ pkgs }: +{ + enable = true; + oh-my-zsh = { + enable = true; + plugins = [ "git" "docker" "zsh-interactive-cd" ]; + theme = "amuse"; + }; + plugins = [ + { + name = "zsh-autosuggestions"; + src = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-autosuggestions"; + rev = "v0.7.0"; + sha256 = "sha256-KLUYpUu4DHRumQZ3w59m9aTW6TBKMCXl2UcKi4uMd7w="; + }; + } + { + name = "shellfirm"; + src = pkgs.fetchFromGitHub { + owner = "kaplanelad"; + repo = "shellfirm"; + rev = "v0.2.7"; + sha256 = "sha256-rUK5YoXpjAdxJhoYIf5yNtUGDGnAXCDIkPrgm4QI2jc="; + }; + } + { + name = "zsh-syntax-highlighting"; + src = pkgs.fetchFromGitHub { + owner = "zsh-users"; + repo = "zsh-syntax-highlighting"; + rev = "0.7.1"; + sha256 = "sha256-gOG0NLlaJfotJfs+SUhGgLTNOnGLjoqnUp54V9aFJg8="; + }; + } + ]; +} diff --git a/services.nix b/services.nix new file mode 100644 index 0000000..daed15c --- /dev/null +++ b/services.nix @@ -0,0 +1,7 @@ +{ + gpg-agent = { + enable = true; + enableSshSupport = true; + pinentryFlavor = "gnome3"; + }; +}