diff --git a/.gitattributes b/.gitattributes index 1033513..42cfb7a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ features/server/services/forgejo-smtp.nix filter=crypt diff=crypt features/server/services/nextcloud-network.nix filter=crypt diff=crypt features/server/backups-repos.nix filter=crypt diff=crypt +hosts/dionysos/features/znc-infos.nix filter=crypt diff=crypt diff --git a/features/client/home-manager/home.nix b/features/client/home-manager/home.nix index b7b56ba..ef691e7 100644 --- a/features/client/home-manager/home.nix +++ b/features/client/home-manager/home.nix @@ -27,7 +27,6 @@ pkgs.jellyfin-mpv-shim pkgs.bitwarden-cli pkgs.moonlight-qt - pkgs.i2pd # # It is sometimes useful to fine-tune packages, for example, by applying # # overrides. You can do that directly here, just don't forget the # # parentheses. Maybe you want to install Nerd Fonts with a limited number of diff --git a/features/client/sway.nix b/features/client/sway.nix index e69de29..fb2aa36 100644 --- a/features/client/sway.nix +++ b/features/client/sway.nix @@ -0,0 +1,19 @@ +{config, pkgs, ...}: { + environment.systemPackages = with pkgs; [ + mako + grim + slurp + wl-clipboard + ]; + + services.gnome.gnome-keyring.enable = true; + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + + xdg.portal.wlr.enable = true; + security.pam.loginLimits = [ + { domain = "@users"; item = "rtprio"; type = "-"; value = 1; } +]; + } diff --git a/features/client/vesktop.nix b/features/client/vesktop.nix new file mode 100644 index 0000000..f56c4cd --- /dev/null +++ b/features/client/vesktop.nix @@ -0,0 +1,3 @@ +{ + + } diff --git a/features/server/services/irc-server.nix b/features/server/services/irc-server.nix new file mode 100644 index 0000000..c8a13cb --- /dev/null +++ b/features/server/services/irc-server.nix @@ -0,0 +1,11 @@ +{config, pkgs, ...}: +{ + services.ircdHybrid = + { + enable = true; + serverName = "irc.hypervirtual.world"; + description = "welcome to the silly kittens hut !! meow:3"; + }; + +} + diff --git a/features/server/services/photoprism.nix b/features/server/services/photoprism.nix deleted file mode 100644 index 4d8cda7..0000000 --- a/features/server/services/photoprism.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ pkgs, config, ... }: -{ - sops.secrets.photoprismAdmin = { }; - sops.secrets.photoprismPassword = { }; - - environment.systemPackages = with pkgs; [ - photoprism - ]; - - services.photoprism = { - enable = true; - port = 2342; - originalsPath = "/srv/cloud/photoprism/originals"; - importPath = "/srv/cloud/photoprism/imports"; - settings = { - PHOTOPRISM_ADMIN_USER = "admin"; - PHOTOPRISM_DEFAULT_LOCALE = "fr"; - PHOTOPRISM_DATABASE_DRIVER = "mysql"; - PHOTOPRISM_DATABASE_NAME = "photoprism"; - PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock"; - PHOTOPRISM_DATABASE_USER = "photoprism"; - PHOTOPRISM_SITE_URL = "http://photos.hypervirtual.world"; - PHOTOPRISM_SITE_TITLE = "hyperreal photoprism???"; - }; - passwordFile = config.sops.secrets.photoprismPassword.path; - }; - - systemd.tmpfiles.rules = [ - "d /srv/cloud/photoprism/originals 0755 photoprism photoprism -" - "d /srv/cloud/photoprism/imports 0755 photoprism photoprism -" - ]; -} diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 0692e23..0000000 --- a/flake.lock +++ /dev/null @@ -1,233 +0,0 @@ -{ - "nodes": { - "alejandra": { - "inputs": { - "fenix": "fenix", - "flakeCompat": "flakeCompat", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660592437, - "narHash": "sha256-xFumnivtVwu5fFBOrTxrv6fv3geHKF04RGP23EsDVaI=", - "owner": "kamadorueda", - "repo": "alejandra", - "rev": "e7eac49074b70814b542fee987af2987dd0520b5", - "type": "github" - }, - "original": { - "owner": "kamadorueda", - "ref": "3.0.0", - "repo": "alejandra", - "type": "github" - } - }, - "fenix": { - "inputs": { - "nixpkgs": [ - "alejandra", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1657607339, - "narHash": "sha256-HaqoAwlbVVZH2n4P3jN2FFPMpVuhxDy1poNOR7kzODc=", - "owner": "nix-community", - "repo": "fenix", - "rev": "b814c83d9e6aa5a28d0cf356ecfdafb2505ad37d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, - "flakeCompat": { - "flake": false, - "locked": { - "lastModified": 1650374568, - "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b4a34015c698c7793d592d66adbab377907a2be8", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "nix-darwin": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1730184279, - "narHash": "sha256-6OB+WWR6gnaWiqSS28aMJypKeK7Pjc2Wm6L0MtOrTuA=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "b379bd4d872d159e5189053ce9a4adf86d56db4b", - "type": "github" - }, - "original": { - "owner": "LnL7", - "repo": "nix-darwin", - "type": "github" - } - }, - "nix-secrets": { - "flake": false, - "locked": { - "lastModified": 1724661327, - "narHash": "sha256-NQ+PmZwUJdDh0d1WiP7ibqw7aFd2Xn+2Xu6wOZV3E8E=", - "ref": "refs/heads/main", - "rev": "750285c41d23803be0b66571296e1f1685939511", - "revCount": 8, - "type": "git", - "url": "https://git.hypervirtual.world/harry123/nix-secrets.git" - }, - "original": { - "type": "git", - "url": "https://git.hypervirtual.world/harry123/nix-secrets.git" - } - }, - "nixlib": { - "locked": { - "lastModified": 1728176478, - "narHash": "sha256-px3Q0W//c+mZ4kPMXq4poztsjtXM1Ja1rN+825YMDUQ=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "b61309c3c1b6013d36299bc8285612865b3b9e4c", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixos-generators": { - "inputs": { - "nixlib": "nixlib", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1728522165, - "narHash": "sha256-UQpsJ0Ev6JBGsCYRlS2oOVvb+eWcDD0xTV3RVlqbeVU=", - "owner": "nix-community", - "repo": "nixos-generators", - "rev": "40c8d30c490414910fc63626ad1b67af7db40cd3", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixos-generators", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1723688146, - "narHash": "sha256-sqLwJcHYeWLOeP/XoLwAtYjr01TISlkOfz+NG82pbdg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c3d4ac725177c030b1e289015989da2ad9d56af0", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1721524707, - "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "556533a23879fc7e5f98dd2e0b31a6911a213171", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1721466660, - "narHash": "sha256-pFSxgSZqZ3h+5Du0KvEL1ccDZBwu4zvOil1zzrPNb3c=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6e14bbce7bea6c4efd7adfa88a40dac750d80100", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "alejandra": "alejandra", - "nix-darwin": "nix-darwin", - "nix-secrets": "nix-secrets", - "nixos-generators": "nixos-generators", - "nixpkgs": "nixpkgs", - "sops-nix": "sops-nix" - } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1657557289, - "narHash": "sha256-PRW+nUwuqNTRAEa83SfX+7g+g8nQ+2MMbasQ9nt6+UM=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "caf23f29144b371035b864a1017dbc32573ad56d", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, - "sops-nix": { - "inputs": { - "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1723501126, - "narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "be0eec2d27563590194a9206f551a6f73d52fa34", - "type": "github" - }, - "original": { - "owner": "Mic92", - "repo": "sops-nix", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix index b9be8fd..77cf532 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,9 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; sops-nix.url = "github:Mic92/sops-nix"; + home-manager.url = "github:nix-community/home-manager/release-24.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + alejandra.url = "github:kamadorueda/alejandra/3.0.0"; alejandra.inputs.nixpkgs.follows = "nixpkgs"; @@ -20,6 +23,13 @@ nix-darwin.url = "github:LnL7/nix-darwin"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + anyrun = { + url = "github:anyrun-org/anyrun"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; }; outputs = @@ -29,6 +39,9 @@ sops-nix, nixos-generators, nix-darwin, + nix-flatpak, + anyrun, + home-manager, ... }@inputs: let @@ -38,6 +51,7 @@ specialArgs = { inherit username; inherit secrets; + inherit inputs; }; in { @@ -65,6 +79,17 @@ specialArgs = specialArgs; modules = [ ./hosts/goober/configuration.nix + nix-flatpak.nixosModules.nix-flatpak + + {environment.systemPackages = [ anyrun.packages."x86_64-linux".anyrun ];} + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.${username} = import ./home-manager/home.nix; + + home-manager.extraSpecialArgs = {inherit inputs;}; + } ]; }; @@ -74,7 +99,6 @@ inherit specialArgs; }; modules = [ - ./hosts/dionysos/configuration.nix ]; }; diff --git a/home-manager/dotfiles/.bashrc b/home-manager/dotfiles/.bashrc new file mode 100644 index 0000000..e69de29 diff --git a/home-manager/dotfiles/.profile b/home-manager/dotfiles/.profile new file mode 100644 index 0000000..e3da064 --- /dev/null +++ b/home-manager/dotfiles/.profile @@ -0,0 +1,6 @@ +export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share + +foot --server +if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] ; then + exec dbus-run-session sway +fi diff --git a/home-manager/dotfiles/cava/config b/home-manager/dotfiles/cava/config new file mode 100644 index 0000000..c314008 --- /dev/null +++ b/home-manager/dotfiles/cava/config @@ -0,0 +1,279 @@ +## Configuration file for CAVA. +# Remove the ; to change parameters. + + +[general] + +# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0 +; mode = normal + +# Accepts only non-negative values. +; framerate = 60 + +# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off +# new as of 0.6.0 autosens of low values (dynamic range) +# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0 +; autosens = 1 +; overshoot = 20 + +# Manual sensitivity in %. If autosens is enabled, this will only be the initial value. +# 200 means double height. Accepts only non-negative values. +; sensitivity = 100 + +# The number of bars (0-512). 0 sets it to auto (fill up console). +# Bars' width and space between bars in number of characters. +; bars = 0 +; bar_width = 2 +; bar_spacing = 1 +# bar_height is only used for output in "noritake" format +; bar_height = 32 + +# For SDL width and space between bars is in pixels, defaults are: +; bar_width = 20 +; bar_spacing = 5 + +# sdl_glsl have these default values, they are only used to calulate max number of bars. +; bar_width = 1 +; bar_spacing = 0 + + +# Lower and higher cutoff frequencies for lowest and highest bars +# the bandwidth of the visualizer. +# Note: there is a minimum total bandwidth of 43Mhz x number of bars. +# Cava will automatically increase the higher cutoff if a too low band is specified. +; lower_cutoff_freq = 50 +; higher_cutoff_freq = 10000 + + +# Seconds with no input before cava goes to sleep mode. Cava will not perform FFT or drawing and +# only check for input once per second. Cava will wake up once input is detected. 0 = disable. +; sleep_timer = 0 + + +[input] + +# Audio capturing method. Possible methods are: 'fifo', 'portaudio', 'pipewire', 'alsa', 'pulse', 'sndio', 'oss', 'jack' or 'shmem' +# Defaults to 'oss', 'pipewire', 'sndio', 'jack', 'pulse', 'alsa', 'portaudio' or 'fifo', in that order, dependent on what support cava was built with. +# On Mac it defaults to 'portaudio' or 'fifo' +# On windows this is automatic and no input settings are needed. +# +# All input methods uses the same config variable 'source' +# to define where it should get the audio. +# +# For pulseaudio and pipewire 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink +# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them). +# +# For pipewire 'source' will be the object name or object.serial of the device to capture from. +# Both input and output devices are supported. +# +# For alsa 'source' will be the capture device. +# For fifo 'source' will be the path to fifo-file. +# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address +# +# For sndio 'source' will be a raw recording audio descriptor or a monitoring sub-device, e.g. 'rsnd/2' or 'snd/1'. Default: 'default'. +# README.md contains further information on how to setup CAVA for sndio. +# +# For oss 'source' will be the path to a audio device, e.g. '/dev/dsp2'. Default: '/dev/dsp', i.e. the default audio device. +# README.md contains further information on how to setup CAVA for OSS on FreeBSD. +# +# For jack 'source' will be the name of the JACK server to connect to, e.g. 'foobar'. Default: 'default'. +# README.md contains further information on how to setup CAVA for JACK. +# +; method = pulse +; source = auto + +method = pipewire +source = auto + +; method = alsa +; source = hw:Loopback,1 + +; method = fifo +; source = /tmp/mpd.fifo + +; method = shmem +; source = /squeezelite-AA:BB:CC:DD:EE:FF + +; method = portaudio +; source = auto + +; method = sndio +; source = default + +; method = oss +; source = /dev/dsp + +; method = jack +; source = default + +# The options 'sample_rate', 'sample_bits', 'channels' and 'autoconnect' can be configured for some input methods: +# sample_rate: fifo, pipewire, sndio, oss +# sample_bits: fifo, pipewire, sndio, oss +# channels: sndio, oss, jack +# autoconnect: jack +# Other methods ignore these settings. +# +# For 'sndio' and 'oss' they are only preferred values, i.e. if the values are not supported +# by the chosen audio device, the device will use other supported values instead. +# Example: 48000, 32 and 2, but the device only supports 44100, 16 and 1, then it +# will use 44100, 16 and 1. +# +; sample_rate = 44100 +; sample_bits = 16 +; channels = 2 +; autoconnect = 2 + + +[output] + +# Output method. Can be 'ncurses', 'noncurses', 'raw', 'noritake', 'sdl' +# or 'sdl_glsl'. +# 'noncurses' (default) uses a buffer and cursor movements to only print +# changes from frame to frame in the terminal. Uses less resources and is less +# prone to tearing (vsync issues) than 'ncurses'. +# +# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data +# stream of the bar heights that can be used to send to other applications. +# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above. +# +# 'noritake' outputs a bitmap in the format expected by a Noritake VFD display +# in graphic mode. It only support the 3000 series graphical VFDs for now. +# +# 'sdl' uses the Simple DirectMedia Layer to render in a graphical context. +# 'sdl_glsl' uses SDL to create an OpenGL context. Write your own shaders or +# use one of the predefined ones. +; method = noncurses + +# Orientation of the visualization. Can be 'bottom', 'top', 'left' or 'right'. +# Default is 'bottom'. Other orientations are only supported on sdl and ncruses +# output. Note: many fonts have weird glyphs for 'top' and 'right' characters, +# which can make ncurses not look right. +; orientation = bottom + +# Visual channels. Can be 'stereo' or 'mono'. +# 'stereo' mirrors both channels with low frequencies in center. +# 'mono' outputs left to right lowest to highest frequencies. +# 'mono_option' set mono to either take input from 'left', 'right' or 'average'. +# set 'reverse' to 1 to display frequencies the other way around. +; channels = stereo +; mono_option = average +; reverse = 0 + +# Raw output target. A fifo will be created if target does not exist. +; raw_target = /dev/stdout + +# Raw data format. Can be 'binary' or 'ascii'. +; data_format = binary + +# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530). +; bit_format = 16bit + +# Ascii max value. In 'ascii' mode range will run from 0 to value specified here +; ascii_max_range = 1000 + +# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters. +# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)). +; bar_delimiter = 59 +; frame_delimiter = 10 + +# sdl window size and position. -1,-1 is centered. +; sdl_width = 1000 +; sdl_height = 500 +; sdl_x = -1 +; sdl_y= -1 +; sdl_full_screen = 0 + +# set label on bars on the x-axis. Can be 'frequency' or 'none'. Default: 'none' +# 'frequency' displays the lower cut off frequency of the bar above. +# Only supported on ncurses and noncurses output. +; xaxis = none + +# enable alacritty synchronized updates. 1 = on, 0 = off +# removes flickering in alacritty terminal emulator. +# defaults to off since the behaviour in other terminal emulators is unknown +; alacritty_sync = 0 + +# Shaders for sdl_glsl, located in $HOME/.config/cava/shaders +; vertex_shader = pass_through.vert +; fragment_shader = bar_spectrum.frag + +; for glsl output mode, keep rendering even if no audio +; continuous_rendering = 0 + +# disable console blank (screen saver) in tty +# (Not supported on FreeBSD) +; disable_blanking = 0 + +# show a flat bar at the bottom of the screen when idle, 1 = on, 0 = off +; show_idle_bar_heads = 1 + +# show waveform instead of frequency spectrum, 1 = on, 0 = off +; waveform = 0 + +[color] + +# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow. +# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires +# a terminal that can change color definitions such as Gnome-terminal or rxvt. +# default is to keep current terminal color +; background = default +; foreground = default + +# SDL and sdl_glsl only support hex code colors, these are the default: +; background = '#111111' +; foreground = '#33ffff' + + +# Gradient mode, only hex defined colors are supported, +# background must also be defined in hex or remain commented out. 1 = on, 0 = off. +# You can define as many as 8 different colors. They range from bottom to top of screen +gradient = 1 +gradient_count = 2 +gradient_color_1 = '#B3EBF2' +gradient_color_2 = '#BF40BF' +; gradient_color_3 = '#a6cc33' +; gradient_color_4 = '#cccc33' +; gradient_color_5 = '#cca633' +; gradient_color_6 = '#cc8033' +; gradient_color_7 = '#cc5933' +; gradient_color_8 = '#cc3333' + + + +[smoothing] + +# Percentage value for integral smoothing. Takes values from 0 - 100. +# Higher values means smoother, but less precise. 0 to disable. +# DEPRECATED as of 0.8.0, use noise_reduction instead +; integral = 77 + +# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. +; monstercat = 0 +; waves = 0 + +# Set gravity percentage for "drop off". Higher values means bars will drop faster. +# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". +# DEPRECATED as of 0.8.0, use noise_reduction instead +; gravity = 100 + + +# In bar height, bars that would have been lower that this will not be drawn. +# DEPRECATED as of 0.8.0 +; ignore = 0 + +# Noise reduction, int 0 - 100. default 77 +# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth +# 100 will be very slow and smooth, 0 will be fast but noisy. +; noise_reduction = 77 + + +[eq] + +# This one is tricky. You can have as much keys as you want. +# Remember to uncomment more than one key! More keys = more precision. +# Look at readme.md on github for further explanations and examples. +; 1 = 1 # bass +; 2 = 1 +; 3 = 1 # midtone +; 4 = 1 +; 5 = 1 # treble diff --git a/home-manager/dotfiles/cava/shaders/bar_spectrum.frag b/home-manager/dotfiles/cava/shaders/bar_spectrum.frag new file mode 100644 index 0000000..b078913 --- /dev/null +++ b/home-manager/dotfiles/cava/shaders/bar_spectrum.frag @@ -0,0 +1,79 @@ +#version 330 + +in vec2 fragCoord; +out vec4 fragColor; + +// bar values. defaults to left channels first (low to high), then right (high to low). +uniform float bars[512]; + +uniform int bars_count; // number of bars (left + right) (configurable) +uniform int bar_width; // bar width (configurable), not used here +uniform int bar_spacing; // space bewteen bars (configurable) + +uniform vec3 u_resolution; // window resolution + +//colors, configurable in cava config file (r,g,b) (0.0 - 1.0) +uniform vec3 bg_color; // background color +uniform vec3 fg_color; // foreground color + +uniform int gradient_count; +uniform vec3 gradient_colors[8]; // gradient colors + +vec3 normalize_C(float y,vec3 col_1, vec3 col_2, float y_min, float y_max) +{ + //create color based on fraction of this color and next color + float yr = (y - y_min) / (y_max - y_min); + return col_1 * (1.0 - yr) + col_2 * yr; +} + +void main() +{ + // find which bar to use based on where we are on the x axis + float x = u_resolution.x * fragCoord.x; + int bar = int(bars_count * fragCoord.x); + + //calculate a bar size + float bar_size = u_resolution.x / bars_count; + + //the y coordinate and bar values are the same + float y = bars[bar]; + + // make sure there is a thin line at bottom + if (y * u_resolution.y < 1.0) + { + y = 1.0 / u_resolution.y; + } + + //draw the bar up to current height + if (y > fragCoord.y) + { + //make some space between bars basen on settings + if (x > (bar + 1) * (bar_size) - bar_spacing) + { + fragColor = vec4(bg_color,1.0); + } + else + { + if (gradient_count == 0) + { + fragColor = vec4(fg_color,1.0); + } + else + { + //find which color in the configured gradient we are at + int color = int((gradient_count - 1) * fragCoord.y); + + //find where on y this and next color is supposed to be + float y_min = color / (gradient_count - 1.0); + float y_max = (color + 1.0) / (gradient_count - 1.0); + + //make color + fragColor = vec4(normalize_C(fragCoord.y, gradient_colors[color], gradient_colors[color + 1], y_min, y_max), 1.0); + } + } + } + else + { + fragColor = vec4(bg_color,1.0); + } +} \ No newline at end of file diff --git a/home-manager/dotfiles/cava/shaders/northern_lights.frag b/home-manager/dotfiles/cava/shaders/northern_lights.frag new file mode 100644 index 0000000..ecd859a --- /dev/null +++ b/home-manager/dotfiles/cava/shaders/northern_lights.frag @@ -0,0 +1,34 @@ +#version 330 + +in vec2 fragCoord; +out vec4 fragColor; + +// bar values. defaults to left channels first (low to high), then right (high to low). +uniform float bars[512]; + +uniform int bars_count; // number of bars (left + right) (configurable) + +uniform vec3 u_resolution; // window resolution, not used here + +//colors, configurable in cava config file +uniform vec3 bg_color; // background color(r,g,b) (0.0 - 1.0), not used here +uniform vec3 fg_color; // foreground color, not used here + +void main() +{ + // find which bar to use based on where we are on the x axis + int bar = int(bars_count * fragCoord.x); + + float bar_y = 1.0 - abs((fragCoord.y - 0.5)) * 2.0; + float y = (bars[bar]) * bar_y; + + float bar_x = (fragCoord.x - float(bar) / float(bars_count)) * bars_count; + float bar_r = 1.0 - abs((bar_x - 0.5)) * 2; + + bar_r = bar_r * bar_r * 2; + + // set color + fragColor.r = fg_color.x * y * bar_r; + fragColor.g = fg_color.y * y * bar_r; + fragColor.b = fg_color.z * y * bar_r; +} diff --git a/home-manager/dotfiles/cava/shaders/pass_through.vert b/home-manager/dotfiles/cava/shaders/pass_through.vert new file mode 100644 index 0000000..a4f20e5 --- /dev/null +++ b/home-manager/dotfiles/cava/shaders/pass_through.vert @@ -0,0 +1,14 @@ +#version 330 + + +// Input vertex data, different for all executions of this shader. +layout(location = 0) in vec3 vertexPosition_modelspace; + +// Output data ; will be interpolated for each fragment. +out vec2 fragCoord; + +void main() +{ + gl_Position = vec4(vertexPosition_modelspace,1); + fragCoord = (vertexPosition_modelspace.xy+vec2(1,1))/2.0; +} diff --git a/home-manager/dotfiles/foot/foot.ini b/home-manager/dotfiles/foot/foot.ini new file mode 100644 index 0000000..65d8f5b --- /dev/null +++ b/home-manager/dotfiles/foot/foot.ini @@ -0,0 +1,241 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +# app-id=foot # globally set wayland app-id. Default values are "foot" and "footclient" for desktop and server mode +# title=foot +# locked-title=no + +font=CodeNewRoman Nerd Font:weight=Regular:size=14 +#font-bold= +#font-italic= +#font-bold-italic= +# font-size-adjustment=0.5 +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# underline-offset= +# underline-thickness= +# strikeout-thickness= +# box-drawings-uses-font-glyphs=no +# dpi-aware=no + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +pad=3x3 # optionally append 'center' +# resize-by-cells=yes +# resize-keep-grid=yes +# resize-delay-ms=100 + +# bold-text-in-bright=no +# word-delimiters=,│`|:"'()[]{}<> +# selection-target=primary +# workers= +# utmp-helper=/usr/lib/utempter/utempter # When utmp backend is ‘libutempter’ (Linux) +# utmp-helper=/usr/libexec/ulog-helper # When utmp backend is ‘ulog’ (FreeBSD) + +[environment] +# name=value + +[bell] +urgent=yes +# notify=no +# visual=no +# command= +# command-focused=no + +# [desktop-notifications] +# command=notify-send --wait --app-name ${app-id} --icon ${app-id} --category ${category} --urgency ${urgency} --expire-time ${expire-time} --hint STRING:image-path:${icon} --hint BOOLEAN:suppress-sound:${muted} --hint STRING:sound-name:${sound-name} --replace-id ${replace-id} ${action-argument} --print-id -- ${title} ${body} +# command-action-argument=--action ${action-name}=${action-label} +# close="" +# inhibit-when-focused=yes + + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format="" + +[url] +# launch=xdg-open ${url} +# label-letters=sadfjklewcmpgh +# osc8-underline=url-mode +# protocols=http, https, ftp, ftps, file, gemini, gopher +# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[] + +[cursor] +# style=block +# color= +blink=yes +# blink-rate=500 +# beam-thickness=1.5 +# underline-thickness= + +[mouse] +# hide-when-typing=no +# alternate-scroll-mode=yes + +[touch] +# long-press-delay=400 + +[colors] +# alpha=1.0 +# background=242424 +# foreground=ffffff +# flash=7f7f00 +# flash-alpha=0.5 + +## Normal/regular colors (color palette 0-7) +# regular0=242424 # black +# regular1=f62b5a # red +# regular2=47b413 # green +# regular3=e3c401 # yellow +# regular4=24acd4 # blue +# regular5=f2affd # magenta +# regular6=13c299 # cyan +# regular7=e6e6e6 # white + +## Bright colors (color palette 8-15) +# bright0=616161 # bright black +# bright1=ff4d51 # bright red +# bright2=35d450 # bright green +# bright3=e9e836 # bright yellow +# bright4=5dc5f8 # bright blue +# bright5=feabf2 # bright magenta +# bright6=24dfc4 # bright cyan +# bright7=ffffff # bright white + +## dimmed colors (see foot.ini(5) man page) +# dim0= +# ... +# dim7= + +## The remaining 256-color palette +# 16 = <256-color palette #16> +# ... +# 255 = <256-color palette #255> + +## Misc colors +# selection-foreground= +# selection-background= +# jump-labels= # black-on-yellow +# scrollback-indicator= # black-on-bright-blue +# search-box-no-match= # black-on-red +# search-box-match= # black-on-yellow +# urls= + +[csd] +# preferred=server +# size=26 +# font= +# color= +# hide-when-maximized=no +# double-click-to-maximize=yes +# border-width=0 +# border-color= +# button-width=26 +# button-color= +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none +# clipboard-copy=Control+Shift+c XF86Copy +# clipboard-paste=Control+Shift+v XF86Paste +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# pipe-command-output=[wl-copy] none # Copy last command's output to the clipboard +# show-urls-launch=Control+Shift+o +# show-urls-copy=none +# show-urls-persistent=none +# prompt-prev=Control+Shift+z +# prompt-next=Control+Shift+x +# unicode-input=Control+Shift+u +# noop=none + +[search-bindings] +# cancel=Control+g Control+c Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-char=Shift+Right +# extend-to-word-boundary=Control+w Control+Shift+Right +# extend-to-next-whitespace=Control+Shift+w +# extend-line-down=Shift+Down +# extend-backward-char=Shift+Left +# extend-backward-to-word-boundary=Control+Shift+Left +# extend-backward-to-next-whitespace=none +# extend-line-up=Shift+Up +# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste +# primary-paste=Shift+Insert +# unicode-input=none +# quit=none +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# scrollback-home=none +# scrollback-end=none + +[url-bindings] +# cancel=Control+g Control+c Control+d Escape +# toggle-url-visible=t + +[text-bindings] +# \x03=Mod4+c # Map Super+c -> Ctrl+c + +[mouse-bindings] +# scrollback-up-mouse=BTN_WHEEL_BACK +# scrollback-down-mouse=BTN_WHEEL_FORWARD +# font-increase=Control+BTN_WHEEL_BACK +# font-decrease=Control+BTN_WHEEL_FORWARD +# selection-override-modifiers=Shift +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-quote = BTN_LEFT-3 +# select-row=BTN_LEFT-4 + +# vim: ft=dosini + +[tweak] +font-monospace-warn=no diff --git a/home-manager/dotfiles/sway/config b/home-manager/dotfiles/sway/config new file mode 100755 index 0000000..3e72535 --- /dev/null +++ b/home-manager/dotfiles/sway/config @@ -0,0 +1,224 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term foot +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +set $menu anyrun | xargs swaymsg exec -- + +# screenshot folder +set $screenshot_folder ~/Images/Captures\ d\'écrans/ + +### Output configuration +# +# Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/) +output * bg wallpapers/577806.jpg fill +# +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# +# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +input * { + xkb_layout "fr,ru" +} + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+ampersand workspace 1 + bindsym $mod+eacute workspace 2 + bindsym $mod+quotedbl workspace 3 + bindsym $mod+apostrophe workspace 4 + bindsym $mod+parenleft workspace 5 + bindsym $mod+minus workspace 6 + bindsym $mod+egrave workspace 7 + bindsym $mod+underscore workspace 8 + bindsym $mod+ccedilla workspace 9 + bindsym $mod+agrave workspace 10 + # Move focused container to workspace + bindsym $mod+1 move container to workspace number 1 + bindsym $mod+2 move container to workspace number 2 + bindsym $mod+3 move container to workspace number 3 + bindsym $mod+4 move container to workspace number 4 + bindsym $mod+5 move container to workspace number 5 + bindsym $mod+6 move container to workspace number 6 + bindsym $mod+7 move container to workspace number 7 + bindsym $mod+8 move container to workspace number 8 + bindsym $mod+9 move container to workspace number 9 + bindsym $mod+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + #bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + #bindsym $mod+minus scratchpad show +# useful shortcuts +bindsym Print exec grim -g $(slurp) | wl-copy +bindsym Ctrl+Print exec grim $screenshot_folder/$(date +'%s_grim.png') +bindsym --locked XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle +bindsym --locked XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.2 +bindsym --locked XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.2 +bindsym XF86AudioPlay exec playerctl play-pause +bindsym XF86AudioPrev exec playerctl previous +bindsym XF86AudioNext exec playerctl next +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + swaybar_command waybar +} + +include /etc/sway/config.d/* diff --git a/home-manager/dotfiles/sway/wallpapers/577806.jpg b/home-manager/dotfiles/sway/wallpapers/577806.jpg new file mode 100644 index 0000000..c1cbae5 Binary files /dev/null and b/home-manager/dotfiles/sway/wallpapers/577806.jpg differ diff --git a/home-manager/dotfiles/sway/wallpapers/wipeout_3_team___wallpaper_by_panopticon36_d734ox5-pre.jpg b/home-manager/dotfiles/sway/wallpapers/wipeout_3_team___wallpaper_by_panopticon36_d734ox5-pre.jpg new file mode 100644 index 0000000..d08135f Binary files /dev/null and b/home-manager/dotfiles/sway/wallpapers/wipeout_3_team___wallpaper_by_panopticon36_d734ox5-pre.jpg differ diff --git a/home-manager/dotfiles/waybar/config.jsonc b/home-manager/dotfiles/waybar/config.jsonc new file mode 100644 index 0000000..42a0310 --- /dev/null +++ b/home-manager/dotfiles/waybar/config.jsonc @@ -0,0 +1,15 @@ +{ + "layer": "top", + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": [], + "modules-right": ["wireplumber","bluetooth", "clock"], + "clock": { + "format-alt": "{:%a, %d. %b %H:%M}" + }, + "wireplumber": { + "format": "{volume}%", + "format-muted": "", + "max-volume": 120, + "scroll-step": 0.2 + } +} diff --git a/home-manager/dotfiles/waybar/style.css b/home-manager/dotfiles/waybar/style.css new file mode 100644 index 0000000..e69de29 diff --git a/home-manager/flake.lock b/home-manager/flake.lock new file mode 100644 index 0000000..8797456 --- /dev/null +++ b/home-manager/flake.lock @@ -0,0 +1,249 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "hercules-ci-effects", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ], + "nixpkgs-stable": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729104314, + "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "neovim-nightly-overlay", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724947644, + "narHash": "sha256-MHHrHasTngp7EYQOObHJ1a/IsRF+wodHqOckhH6uZbk=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "dba4367b9a9d9615456c430a6d6af716f6e84cef", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729260213, + "narHash": "sha256-jAvHoU/1y/yCuXzr2fNF+q6uKmr8Jj2xgAisK4QB9to=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "09a0c0c02953318bf94425738c7061ffdc4cba75", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "neovim-nightly-overlay": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "hercules-ci-effects": "hercules-ci-effects", + "neovim-src": "neovim-src", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1729147490, + "narHash": "sha256-F0/iQVbbIFctMPwK4JEd4fxVzNwaq7NnD5oen59S24s=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "e2047498667aeb24e8493ff430a20cff713915f4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1729121305, + "narHash": "sha256-c94xkA/RuszC4PfmB+MWqOo2vbO66GTO6XKer0mbltA=", + "owner": "neovim", + "repo": "neovim", + "rev": "852954ff6d96adce0158f74ca494fdcef3aa1921", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1728863046, + "narHash": "sha256-DZBO2465PL5V89e8hFSJewyH4QbCPpW3ssws7ckT/0A=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d4f247e89f6e10120f911e2e2d2254a050d0f732", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1728888510, + "narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "neovim-nightly-overlay": "neovim-nightly-overlay", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home-manager/flake.nix b/home-manager/flake.nix new file mode 100644 index 0000000..92c5ca0 --- /dev/null +++ b/home-manager/flake.nix @@ -0,0 +1,41 @@ +{ + description = "Home Manager configuration of harry123"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; + }; + + outputs = { nixpkgs, home-manager, ... }@inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + overlays = [ + inputs.neovim-nightly-overlay.overlays.default + ]; + in { + homeConfigurations."harry123" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ ./home.nix + { + nixpkgs.overlays = overlays; + } + ]; + + specialArgs = { + inherit inputs; + }; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..a70495e --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,142 @@ +{ config, pkgs, osConfig, inputs, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "harry123"; + home.homeDirectory = "/home/harry123"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "24.05"; # Please read the comment before changing. + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "vscode" + ]; + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = [ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + (pkgs.nerdfonts.override { fonts = [ "CodeNewRoman" ]; }) + + pkgs.zoxide + pkgs.btop + #pkgs.bitwarden + pkgs.weechat + pkgs.eclipses.eclipse-java # school wants us to use it... + pkgs.cava + pkgs.hyfetch + pkgs.kittysay + pkgs.nextcloud-client + pkgs.thunderbird-bin + pkgs.feh + pkgs.waybar + + pkgs.playerctl + pkgs.wf-recorder + + pkgs.file + pkgs.osu-lazer-bin + + pkgs.qbittorrent + + pkgs.i2pd + pkgs.vscode + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + ".config/sway".source = dotfiles/sway; + ".config/foot".source = dotfiles/foot; + ".profile".source = dotfiles/.profile; + ".config/waybar".source = dotfiles/waybar; + ".config/cava".source = dotfiles/cava; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + imports = [ + inputs.anyrun.homeManagerModules.default + ]; + + programs.anyrun = { + enable = true; + config = { + hideIcons = false; + showResultsImmediately = true; + maxEntries = 10; + closeOnClick = true; + x = { fraction = 0.5; }; + y = { fraction = 0.3; }; + width = { fraction = 0.3; }; + layer = "overlay"; + plugins = [ + inputs.anyrun.packages.${pkgs.system}.applications + inputs.anyrun.packages.${pkgs.system}.rink + inputs.anyrun.packages.${pkgs.system}.translate + inputs.anyrun.packages.${pkgs.system}.dictionary + inputs.anyrun.packages.${pkgs.system}.websearch + ]; + }; + + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/harry123/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + }; + + programs.git = { + userName = "harry123"; + userEmail = "harryh@ik.me"; + enable = true; + extraConfig = { + credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret"; + }; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/hosts/dionysos/configuration.nix b/hosts/dionysos/configuration.nix index 9a62620..6c17d64 100644 --- a/hosts/dionysos/configuration.nix +++ b/hosts/dionysos/configuration.nix @@ -29,6 +29,8 @@ in }; users.users.${username}.initialHashedPassword = "$y$j9T$s4isXqWcg4N8TEPjmj0fD/$zog2cpUwstnvwDnQsFmH3br/WAeD2Uu/L7ePr00cKkA"; + + environment.variables.EDITOR = "nvim"; services.nginx = { @@ -63,4 +65,5 @@ in clientID = ""; keyFile = ""; }; + }; } diff --git a/hosts/dionysos/features/znc-bounce.nix b/hosts/dionysos/features/znc-bounce.nix new file mode 100644 index 0000000..ac6f134 --- /dev/null +++ b/hosts/dionysos/features/znc-bounce.nix @@ -0,0 +1,18 @@ +{config, ...}: { + + services.znc = { + enable = true; + mutable = false; # Overwrite configuration set by ZNC from the web and chat interfaces. + useLegacyConfig = false; # Turn off services.znc.confOptions and their defaults. + openFirewall = true; # ZNC uses TCP port 5000 by default. + config = { + Listener = { + "Motd" = "welcome to hypervirtual's irc bouncer - using znc"; + "SSLProtocols" = "-SSLv2 -SSLv3 -TLSv1 +TLSv1.1 +TLSv1.2" + }; + + ; + }; + + }; +} diff --git a/hosts/dionysos/features/znc-infos.nix b/hosts/dionysos/features/znc-infos.nix new file mode 100644 index 0000000..2aac97e --- /dev/null +++ b/hosts/dionysos/features/znc-infos.nix @@ -0,0 +1,24 @@ +{config, ...}: { + services.znc.config.User."computemadness_" = { + Admin = true; + Nick = "computemadness_"; + AltNick = "kumputemadness_"; + LoadModule = [ "chanserver" "controlpanel" ]; + Network = { + libera = { + Server = "irc.libera.chat +6697"; + LoadModule = "simple_away"; + Chan = { + "#nixos" = {Detached = false;}; + } + }; + koshkairc = { + Server = "irc.koshka.love +6697"; + Chan = { + "#" = {Detached = false;}; + "#speakez" = {Detached = false;}; + }; + }; + }; + }; +} diff --git a/hosts/goober/configuration.nix b/hosts/goober/configuration.nix index 805f340..edacba7 100644 --- a/hosts/goober/configuration.nix +++ b/hosts/goober/configuration.nix @@ -1,5 +1,131 @@ -{ config, ... }: +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, inputs, ... }: + { - services.flatpak.enable = true; + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../features/client/tailscale.nix + ../../features/client/sway.nix + ./features/default.nix + ]; + + nixpkgs.config.allowUnfree = true; + boot.loader = { + efi.canTouchEfiVariables = true; + grub = { + enable = true; + devices = ["nodev"]; + efiSupport = true; + useOSProber = true; + }; + }; + + time.hardwareClockInLocalTime = true; + + networking.hostName = "goober"; # Define your hostname. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + time.timeZone = "Europe/Paris"; + + # Select internationalisation properties. + i18n.defaultLocale = "fr_FR.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "fr"; + # useXkbConfig = true; # use xkb.options in tty. + }; + + # mount compression + fileSystems = { + "/".options = ["compress=zstd"]; + "/home".options = ["compress=zstd"]; + "/nix".options = ["compress=zstd" "noatime"]; + #"/swap".options = ["compress=zstd"]; + }; + + services.btrfs.autoScrub.enable = true; + services.btrfs.autoScrub.interval = "weekly"; + + nix.settings.experimental-features = ["nix-command" "flakes"]; + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.harry123 = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + firefox + tailscale + mpv + logisim-evolution + ]; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + wget + dwl + git + tmux + mako + grim + slurp + wl-clipboard + ]; + + # 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; + }; + + services.udisks2.enable = 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 option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "24.05"; # Did you read the comment? } + diff --git a/hosts/goober/features/default.nix b/hosts/goober/features/default.nix new file mode 100644 index 0000000..f86a2b2 --- /dev/null +++ b/hosts/goober/features/default.nix @@ -0,0 +1,6 @@ +{config, ...}: { + imports = [ + ./software/default.nix + ./hardware/default.nix + ]; +} diff --git a/hosts/goober/features/hardware/bluetooth.nix b/hosts/goober/features/hardware/bluetooth.nix new file mode 100644 index 0000000..cf7051e --- /dev/null +++ b/hosts/goober/features/hardware/bluetooth.nix @@ -0,0 +1,18 @@ +{config, pkgs, ...}: { + hardware.bluetooth.enable = true; # enables support for Bluetooth + hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot + services.blueman.enable = true; + + systemd.user.services.mpris-proxy = { + description = "Mpris proxy"; + after = [ "network.target" "sound.target" ]; + wantedBy = [ "default.target" ]; + serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; + }; + + hardware.bluetooth.settings = { + General = { + Experimental = true; + }; + }; +} diff --git a/hosts/goober/features/hardware/default.nix b/hosts/goober/features/hardware/default.nix new file mode 100644 index 0000000..3c3a59c --- /dev/null +++ b/hosts/goober/features/hardware/default.nix @@ -0,0 +1,7 @@ +{config, ...}: +{ + imports = [ + ./bluetooth.nix + ./pipewire.nix + ]; +} diff --git a/hosts/goober/features/hardware/pipewire.nix b/hosts/goober/features/hardware/pipewire.nix new file mode 100644 index 0000000..9c115fc --- /dev/null +++ b/hosts/goober/features/hardware/pipewire.nix @@ -0,0 +1,25 @@ +{config, ...}: +{ + 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; + wireplumber.extraConfig."10-bluez" = { + "monitor.bluez.properties" = { + "bluez5.enable-sbc-xq" = true; + "bluez5.enable-msbc" = true; + "bluez5.enable-hw-volume" = true; + "bluez5.roles" = [ + "hsp_hs" + "hsp_ag" + "hfp_hf" + "hfp_ag" + ]; + }; + }; + }; +} diff --git a/hosts/goober/features/software/default.nix b/hosts/goober/features/software/default.nix new file mode 100644 index 0000000..84fecea --- /dev/null +++ b/hosts/goober/features/software/default.nix @@ -0,0 +1,8 @@ +{config, ...}: +{ + imports = [ + ./neovim.nix + ./flatpak.nix + ./discord.nix + ]; +} diff --git a/hosts/goober/features/software/discord.nix b/hosts/goober/features/software/discord.nix new file mode 100644 index 0000000..6472a05 --- /dev/null +++ b/hosts/goober/features/software/discord.nix @@ -0,0 +1,9 @@ +{config, pkgs, ...}: +{ + environment.systemPackages = with pkgs; [ + (discord.override { + withOpenASAR = true; # can do this here too + withVencord = true; + }) + ]; +} diff --git a/hosts/goober/features/software/flatpak.nix b/hosts/goober/features/software/flatpak.nix new file mode 100644 index 0000000..5e16022 --- /dev/null +++ b/hosts/goober/features/software/flatpak.nix @@ -0,0 +1,15 @@ +{config, ...}: { + services.flatpak.enable = true; + + services.flatpak.packages = [ + "io.github.zen_browser.zen" + "dev.vencord.Vesktop" + "com.unicornsonlsd.finamp" + ]; + + services.flatpak.update.onActivation = true; + services.flatpak.update.auto = { + enable = true; + onCalendar = "weekly"; # Default value + }; +} diff --git a/hosts/goober/features/software/neovim.nix b/hosts/goober/features/software/neovim.nix new file mode 100644 index 0000000..c8d647b --- /dev/null +++ b/hosts/goober/features/software/neovim.nix @@ -0,0 +1,11 @@ +{inputs, config, pkgs, ...}: { + environment.systemPackages = with pkgs; [ + inputs.neovim-nightly-overlay.packages.${pkgs.system}.default + ]; + + programs.neovim = { + enable = true; + package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default; + defaultEditor = true; + }; +} diff --git a/hosts/goober/hardware-configuration.nix b/hosts/goober/hardware-configuration.nix new file mode 100644 index 0000000..1d4a545 --- /dev/null +++ b/hosts/goober/hardware-configuration.nix @@ -0,0 +1,53 @@ +# 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" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" "wl" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4efbf111-4cbb-4e1e-b3ee-dc3fca1f6f4a"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/4efbf111-4cbb-4e1e-b3ee-dc3fca1f6f4a"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/4efbf111-4cbb-4e1e-b3ee-dc3fca1f6f4a"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/6946-B7B0"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s20f0u2c4i2.useDHCP = lib.mkDefault true; + # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}