Adding nixos-hardware for t480; some nixvim stuff and hyprland

This commit is contained in:
xqtc161 2024-02-10 14:52:08 +01:00
parent e8a41459c1
commit 797080d5c3
9 changed files with 287 additions and 43 deletions

View file

@ -118,15 +118,15 @@
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1705659542,
"narHash": "sha256-WA3xVfAk1AYmFdwghT7mt/erYpsU6JPu9mdTEP/e9HQ=",
"lastModified": 1706981411,
"narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "10cd9c53115061aa6a0a90aad0b0dde6a999cdb9",
"rev": "652fda4ca6dafeb090943422c34ae9145787af37",
"type": "github"
},
"original": {
@ -136,13 +136,29 @@
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1707211557,
"narHash": "sha256-LTKTzZ6fM5j8XWXf51IMBzDaOaJg9kYWLUZxoIhzRN8=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "6e5cc385fc8cf5ca6495d70243074ccdea9f64c7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1706718339,
"narHash": "sha256-S+S97c/HzkO2A/YsU7ZmNF9w2s7Xk6P8dzmfDdckzLs=",
"lastModified": 1707347730,
"narHash": "sha256-0etC/exQIaqC9vliKhc3eZE2Mm2wgLa0tj93ZF/egvM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "53fbe41cf76b6a685004194e38e889bc8857e8c2",
"rev": "6832d0d99649db3d65a0e15fa51471537b2c56a6",
"type": "github"
},
"original": {
@ -168,6 +184,22 @@
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1707268954,
"narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"beautysh": "beautysh",
@ -248,7 +280,9 @@
"inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim"
}
},

View file

@ -2,14 +2,16 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
#inputs.nvidia_pinned = {
# inputs.nixpkgs.follows = "nixos-unstable";
#};
inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master";
inputs.nixvim = {
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of nixvim.
url = "github:nix-community/nixvim/nixos-23.11";
@ -17,19 +19,13 @@
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {self, nixpkgs, home-manager, nixvim, ...}: let
outputs = inputs @ {self, nixpkgs, nixpkgs-unstable, home-manager, nixos-hardware, nixvim, ...}: let
lib = nixpkgs.lib;
util = (import ./overlays/util.nix {} {}).util;
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; overlays =
util.nixFilesIn ./overlays; };
in {
#nixosConfigurations = {
# lambda = lib.nixosSystem {
# system = "x86_64-linux";
# modules = [ ./lambda/ ];
# };
#};
nixosConfigurations = pkgs.util.mapHostAttrs (host: host) (host: lib.nixosSystem {
inherit system;
modules = [ ./hosts/${host} home-manager.nixosModules.home-manager {
@ -37,8 +33,9 @@
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = inputs;
home-manager.users.xqtc = {...}: {imports = [ ./home/lambda nixvim.homeManagerModules.nixvim ]; };
home-manager.users.xqtc = {...}: {imports = [ ./home nixvim.homeManagerModules.nixvim ]; };
}
(lib.optionalString (host == "lilith") inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480)
];
});
};

View file

@ -1,5 +1,5 @@
let carapace_completer = {|spans|
carapace $spans.0 nushell $spans | from json
carapace ...$spans.0 nushell ...$spans | from json
}
$env.config = {
table: {

View file

@ -0,0 +1,180 @@
########################################################################################
AUTOGENERATED HYPR CONFIG.
PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
########################################################################################
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
autogenerated = 0 # remove this line to remove the warning
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
exec-once = waybar & hyprpaper & dunst &
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = de
kb_variant =
kb_model =
kb_options =
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = no
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(ff00abee) rgba(d500baee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10
blur {
size = 4
passes = 1
new_optimizations = on
}
drop_shadow = yes
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = yes
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = on
workspace_swipe_invert = true
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic mouse V1 {
sensitivity = -0.5
}
# Example windowrule v1
windowrule = float, ^(wezterm)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod SHIFT, return, exec, wezterm
bind = $mainMod SHIFT, U, exec, systemctl suspend; swaylock -k -F --image ~/Pictures/walls/1538974492308.png
bind = $mainMod SHIFT, Q, killactive,
bind = $mainMod SHIFT, X, exit,
bind = $mainMod, L, exec, swaylock --indicator --clock --effect-blur 7x5 -e -f -i ~/dotfiles_new/walls/walls/1685550590567432.png
bind = $mainMod SHIFT, SPACE, togglefloating,
bind = $mainMod, P, exec, tofi-drun --drun-launch=true
bind = $mainMod SHIFT, P, exec, tofi, # dwindle
bind = $mainMod, J, togglesplit, # dwindle
bind = $mainMod SHIFT, I, exec, grimshot copy area
bind = $mainMod, N, exec, neovide
bind = $mainMod, Z, exec, zathura
bind = ,XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5%
bind = ,XF86AudioLowerVolume, exec, zsh -c "pactl set-sink-volume @DEFAULT_SINK@ 5%-"
bind = ,XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle
bind = ,XF86MonBrightnessUp, exec, brightnessctl s +5%
bind = ,XF86MonBrightnessDown, exec, brightnessctl s 5%-
bind = ,XF86Search, exec, brightnessctl --device='kbd_backlight' set +5%
bind = ,XF86LaunchA, exec, brightnessctl --device='kbd_backlight' set 5%-
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

View file

@ -1,8 +1,19 @@
local config = {}
function getHostname()
local handle = io.popen("hostname -s")
local result = handle:read("*a")
handle:close()
return string.gsub(result, "\n$", "")
end
config.color_scheme = "Catppuccin Mocha"
config.font = wezterm.font 'Hack Nerd Font Mono'
config.font_size = 12
if getHostname() == "lilith" then
config.font_size = 15
else
config.font_size = 11
end
config.window_background_opacity = .8
--config.window_background_image = "/home/xqtc/dotfiles_new/walls/walls/SMT 40.png"
@ -27,12 +38,12 @@ config.keys = {
}
}
for i = 1, 8 do
-- CTRL+ALT + number to activate that tab
table.insert(config.keys, {
key = tostring(i),
mods = 'CTRL',
action = wezterm.action.ActivateTab(i - 1),
})
-- CTRL+ALT + number to activate that tab
table.insert(config.keys, {
key = tostring(i),
mods = 'CTRL',
action = wezterm.action.ActivateTab(i - 1),
})
end
config.text_background_opacity = .4

View file

@ -88,6 +88,8 @@
lsp = {
enable = true;
servers = {
lua-ls.enable = true;
clangd.enable = true;
svelte.enable = true;
tsserver.enable = true;
eslint.enable = true;
@ -220,15 +222,15 @@
}
];
};
#wayland.windowManager.hyprland = {
# enable = true;
# package = pkgs.hyprland;
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
# xwayland.enable = true;
xwayland.enable = true;
# enableNvidiaPatches = true;
#};
#enableNvidiaPatches = true;
extraConfig = builtins.readFile ./config-files/hyprland.conf;
};
#home.file."~/.config/hypr/hyprland.conf.
@ -277,4 +279,3 @@
programs.home-manager.enable = true;
}

View file

@ -1,9 +1,11 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, nixos-hardware, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
#nixos-hardware.nixosModules.lenovo.thinkpad.t480
#(builtins.getFlake (builtins.fetchGit "github:NixOs/nixos-hardware")).nixosModules.lenovo-thinkpad-t480
];
nixpkgs.config.allowUnfree = true;
@ -60,10 +62,10 @@
# };
# Enable the X11 windowing system.
#services.xserver.enable = true;
#services.xserver.displayManager.gdm.enable = true;
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
#services.xserver.displayManager.ly.enable = true;
#services.xserver.desktopManager.gnome.enable = true;
services.xserver.desktopManager.gnome.enable = true;
#services.xserver.displayManager.defaultSession = "plasmawayland";
#services.xserver.videoDrivers = ["nvidia"];
@ -77,12 +79,31 @@
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio = {
#sound.enable = true;
#hardware.pulseaudio = {
# enable = true;
# package = pkgs.pulseaudioFull;
#};
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
package = pkgs.pulseaudioFull;
alsa.enable = true;
alsa.support32Bit = true;
#pulse.enable = true;
# If you want to use JACK applications, uncomment this
jack.enable = true;
};
environment.etc = {
"wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = ''
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true,
["bluez5.enable-msbc"] = true,
["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
}
'';
};
# Enable touchpad support (enabled default in most desktopManager).
services.xserver.libinput.enable = true;
@ -91,7 +112,6 @@
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
packages = with pkgs; [
wezterm
nushell
];
shell = pkgs.nushell;
@ -115,6 +135,7 @@
waybar
wl-clipboard
wdisplays
gnomeExtensions.blur-my-shell
];
# Some programs need SUID wrappers, can be configured further or are