From 4e8291bb149c3b977993c0bebed88103a5abc7bb Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sun, 9 Jun 2024 08:43:32 +0200 Subject: [PATCH] Add pianonix, create modules and augment others --- homes/x86_64-linux/julian@aspi/default.nix | 77 +++------- homes/x86_64-linux/julian@kardorf/default.nix | 90 ++++-------- .../x86_64-linux/julian@kardorf/packages.nix | 4 +- .../x86_64-linux/julian@pianonix/default.nix | 47 ++++++ modules/home/alacritty/default.nix | 45 +++--- modules/home/fish/default.nix | 66 +++++---- modules/home/neovim/default.nix | 8 +- modules/home/nix-helper/default.nix | 37 +++++ modules/nixos/locales/default.nix | 47 ++++++ systems/x86_64-linux/kardorf/default.nix | 105 ++++++++------ systems/x86_64-linux/pianonix/default.nix | 135 ++++++++++++++++++ 11 files changed, 452 insertions(+), 209 deletions(-) create mode 100644 homes/x86_64-linux/julian@pianonix/default.nix create mode 100644 modules/home/nix-helper/default.nix create mode 100644 modules/nixos/locales/default.nix create mode 100644 systems/x86_64-linux/pianonix/default.nix diff --git a/homes/x86_64-linux/julian@aspi/default.nix b/homes/x86_64-linux/julian@aspi/default.nix index 1a2663a..025ffbd 100644 --- a/homes/x86_64-linux/julian@aspi/default.nix +++ b/homes/x86_64-linux/julian@aspi/default.nix @@ -1,22 +1,25 @@ { -# Snowfall Lib provides a customized `lib` instance with access to your flake's library -# as well as the libraries available from your flake's inputs. -lib, -# An instance of `pkgs` with your overlays and packages applied is also available. -pkgs, -# You also have access to your flake's inputs. -inputs, + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, -# Additional metadata is provided by Snowfall Lib. -home, # The home architecture for this host (eg. `x86_64-linux`). -target, # The Snowfall Lib target for this home (eg. `x86_64-home`). -format, # A normalized name for the home target (eg. `home`). -virtual -, # A boolean to determine whether this home is a virtual target using nixos-generators. -host, # The host name for this home. + # Additional metadata is provided by Snowfall Lib. + namespace, # The namespace used for your flake, defaulting to "internal" if not set. + home, # The home architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this home (eg. `x86_64-home`). + format, # A normalized name for the home target (eg. `home`). + virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. + host, # The host name for this home. -# All other arguments come from the home home. -config, ... }: { + # All other arguments come from the home home. + config, + ... +}: +{ home.username = "julian"; home.homeDirectory = "/home/julian"; @@ -35,6 +38,7 @@ config, ... }: { emacs.enable = true; i3.enable = true; rofi.enable = true; + nix-helper.enable = true; }; home.packages = with pkgs; [ @@ -54,7 +58,6 @@ config, ... }: { unstable.rust-analyzer # Further tools - unstable.nh # nix helper cntr # nix debugger (lib.frajul.my-helper-function lazygit) @@ -71,46 +74,6 @@ config, ... }: { pkgs.frajul.edit-config ]; - 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. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. 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 - # /etc/profiles/per-user/julian/etc/profile.d/hm-session-vars.sh - # - # - - home.shellAliases = { - g = "git status"; - fd = "fd -HI"; - ls = "ls --color"; - la = "ls -Alh --color"; - grep = "grep --color"; - conf = "edit-config"; - c = "fzf-z"; - }; - - home.sessionVariables = { - TERMINAL = "alacritty"; - EDITOR = "nvim"; - VISUAL = "nvim"; - FLAKE = "/home/julian/.dotfiles"; - }; - # Let Home Manager install and manage itself. programs.home-manager.enable = true; } diff --git a/homes/x86_64-linux/julian@kardorf/default.nix b/homes/x86_64-linux/julian@kardorf/default.nix index 1023369..7600cdc 100644 --- a/homes/x86_64-linux/julian@kardorf/default.nix +++ b/homes/x86_64-linux/julian@kardorf/default.nix @@ -1,22 +1,25 @@ { -# Snowfall Lib provides a customized `lib` instance with access to your flake's library -# as well as the libraries available from your flake's inputs. -lib, -# An instance of `pkgs` with your overlays and packages applied is also available. -pkgs, -# You also have access to your flake's inputs. -inputs, + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, -# Additional metadata is provided by Snowfall Lib. -home, # The home architecture for this host (eg. `x86_64-linux`). -target, # The Snowfall Lib target for this home (eg. `x86_64-home`). -format, # A normalized name for the home target (eg. `home`). -virtual -, # A boolean to determine whether this home is a virtual target using nixos-generators. -host, # The host name for this home. + # Additional metadata is provided by Snowfall Lib. + namespace, # The namespace used for your flake, defaulting to "internal" if not set. + home, # The home architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this home (eg. `x86_64-home`). + format, # A normalized name for the home target (eg. `home`). + virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. + host, # The host name for this home. -# All other arguments come from the home home. -config, ... }: { + # All other arguments come from the home home. + config, + ... +}: +{ home.username = "julian"; home.homeDirectory = "/home/julian"; @@ -33,61 +36,26 @@ config, ... }: { neovim.enable = true; alacritty.enable = true; emacs.enable = true; - i3 = { enable = true; }; + i3 = { + enable = true; + }; rofi.enable = true; + nix-helper.enable = true; }; - home.packages = lib.lists.concatMap - (packages-list-file: import packages-list-file { inherit pkgs; }) [ - ./fonts.nix - ./packages.nix - ]; + home.packages = + lib.lists.concatMap (packages-list-file: import packages-list-file { inherit pkgs; }) + [ + ./fonts.nix + ./packages.nix + ]; fonts.fontconfig.enable = true; # required to autoload fonts from packages - 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. - # ".screenrc".source = dotfiles/screenrc; - - # # You can also set the file content immediately. - # ".gradle/gradle.properties".text = '' - # org.gradle.console=verbose - # org.gradle.daemon.idletimeout=3600000 - # ''; - }; - - # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. 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 - # /etc/profiles/per-user/julian/etc/profile.d/hm-session-vars.sh - # - # - gtk = { enable = true; theme.name = "Adwaita-dark"; }; - home.shellAliases = { - g = "git status"; - fd = "fd -HI"; - ls = "ls --color"; - la = "ls -Alh --color"; - grep = "grep --color"; - conf = "edit-config"; - c = "fzf-z"; - }; - - home.sessionVariables = { - TERMINAL = "alacritty"; - EDITOR = "nvim"; - VISUAL = "nvim"; - }; - # Let Home Manager install and manage itself. programs.home-manager.enable = true; } diff --git a/homes/x86_64-linux/julian@kardorf/packages.nix b/homes/x86_64-linux/julian@kardorf/packages.nix index 893af9f..56aedf6 100644 --- a/homes/x86_64-linux/julian@kardorf/packages.nix +++ b/homes/x86_64-linux/julian@kardorf/packages.nix @@ -1,6 +1,7 @@ { pkgs, ... }: -with pkgs; [ +with pkgs; +[ shellcheck @@ -163,6 +164,7 @@ with pkgs; [ # cudaPackages.cudatoolkit # openmvg # colmapWithCuda + path-of-building ## My scripts frajul.edit-config diff --git a/homes/x86_64-linux/julian@pianonix/default.nix b/homes/x86_64-linux/julian@pianonix/default.nix new file mode 100644 index 0000000..94c9d69 --- /dev/null +++ b/homes/x86_64-linux/julian@pianonix/default.nix @@ -0,0 +1,47 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, + + # Additional metadata is provided by Snowfall Lib. + namespace, # The namespace used for your flake, defaulting to "internal" if not set. + home, # The home architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this home (eg. `x86_64-home`). + format, # A normalized name for the home target (eg. `home`). + virtual, # A boolean to determine whether this home is a virtual target using nixos-generators. + host, # The host name for this home. + + # All other arguments come from the home home. + config, + ... +}: +{ + home.username = "julian"; + home.homeDirectory = "/home/julian"; + + # DO NOT CHANGE!!! + home.stateVersion = "23.11"; + + modules = { + shell = { + fish.enable = true; + }; + topgrade.enable = true; + neovim.enable = true; + alacritty.enable = true; + nix-helper.enable = true; + }; + + home.packages = with pkgs; [ ]; + + home.sessionVariables = { + FLAKE = "/home/julian/.dotfiles"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/modules/home/alacritty/default.nix b/modules/home/alacritty/default.nix index 88abda7..8ad9b68 100644 --- a/modules/home/alacritty/default.nix +++ b/modules/home/alacritty/default.nix @@ -1,28 +1,33 @@ { -# Snowfall Lib provides a customized `lib` instance with access to your flake's library -# as well as the libraries available from your flake's inputs. -lib, -# An instance of `pkgs` with your overlays and packages applied is also available. -pkgs, -# You also have access to your flake's inputs. -inputs, + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, -# Additional metadata is provided by Snowfall Lib. -system, # The system architecture for this host (eg. `x86_64-linux`). -target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). -format, # A normalized name for the system target (eg. `iso`). -virtual -, # A boolean to determine whether this system is a virtual target using nixos-generators. -systems, # An attribute map of your defined hosts. + # Additional metadata is provided by Snowfall Lib. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. -# All other arguments come from the module system. -config, ... }: + # All other arguments come from the module system. + config, + ... +}: with lib; -let cfg = config.modules.alacritty; -in { - options.modules.alacritty = { enable = mkOption { default = false; }; }; +let + cfg = config.modules.alacritty; +in +{ + options.modules.alacritty = { + enable = mkOption { default = false; }; + }; config = mkIf cfg.enable { # Does not work on non-nixos due to opengl @@ -32,5 +37,7 @@ in { ".config/alacritty/theme".source = "${inputs.alacritty-theme}"; ".config/alacritty/alacritty.toml".source = ./alacritty.toml; }; + + home.sessionVariables.TERMINAL = "alacritty"; }; } diff --git a/modules/home/fish/default.nix b/modules/home/fish/default.nix index 003167c..8fc0733 100644 --- a/modules/home/fish/default.nix +++ b/modules/home/fish/default.nix @@ -1,39 +1,53 @@ { -# Snowfall Lib provides a customized `lib` instance with access to your flake's library -# as well as the libraries available from your flake's inputs. -lib, -# An instance of `pkgs` with your overlays and packages applied is also available. -pkgs, -# You also have access to your flake's inputs. -inputs, + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, -# Additional metadata is provided by Snowfall Lib. -system, # The system architecture for this host (eg. `x86_64-linux`). -target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). -format, # A normalized name for the system target (eg. `iso`). -virtual -, # A boolean to determine whether this system is a virtual target using nixos-generators. -systems, # An attribute map of your defined hosts. + # Additional metadata is provided by Snowfall Lib. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. -# All other arguments come from the module system. -config, ... }: + # All other arguments come from the module system. + config, + ... +}: with lib; -let cfg = config.modules.shell.fish; -in { - options.modules.shell.fish = { enable = mkOption { default = false; }; }; +let + cfg = config.modules.shell.fish; +in +{ + options.modules.shell.fish = { + enable = mkOption { default = false; }; + }; config = mkIf cfg.enable { home.file = { ".config/starship.toml".source = ./starship.toml; - ".config/fish/conf.d/last-working-dir.fish".source = - ./last-working-dir.fish; + ".config/fish/conf.d/last-working-dir.fish".source = ./last-working-dir.fish; }; home.packages = with pkgs; [ starship ]; + home.shellAliases = { + g = "git status"; + fd = "fd -HI"; + ls = "ls --color"; + la = "ls -Alh --color"; + grep = "grep --color"; + conf = "edit-config"; + c = "fzf-z"; + }; + programs.starship = { enable = true; enableFishIntegration = true; @@ -44,10 +58,12 @@ in { interactiveShellInit = "set fish_greeting"; # Disable default greeting - plugins = [{ - name = "z"; - src = pkgs.fishPlugins.z.src; - }]; + plugins = [ + { + name = "z"; + src = pkgs.fishPlugins.z.src; + } + ]; functions = { fzf-z = '' diff --git a/modules/home/neovim/default.nix b/modules/home/neovim/default.nix index b76dc89..0521231 100644 --- a/modules/home/neovim/default.nix +++ b/modules/home/neovim/default.nix @@ -25,8 +25,12 @@ in { options.modules.neovim = { enable = mkOption { default = false; }; }; config = mkIf cfg.enable { - programs = { - neovim = let + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + }; + + programs.neovim = let toLua = str: '' lua << EOF ${str} diff --git a/modules/home/nix-helper/default.nix b/modules/home/nix-helper/default.nix new file mode 100644 index 0000000..6fdc0d4 --- /dev/null +++ b/modules/home/nix-helper/default.nix @@ -0,0 +1,37 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, + + # Additional metadata is provided by Snowfall Lib. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. + + # All other arguments come from the module system. + config, + ... +}: + +let + cfg = config.modules.nix-helper; +in +{ + options.modules.nix-helper = { + enable = lib.mkOption { default = false; }; + }; + + config = lib.mkIf cfg.enable { + home.sessionVariables = { + FLAKE = "/home/julian/.dotfiles"; + }; + + home.packages = with pkgs; [ nh ]; + }; +} diff --git a/modules/nixos/locales/default.nix b/modules/nixos/locales/default.nix new file mode 100644 index 0000000..9c93d9a --- /dev/null +++ b/modules/nixos/locales/default.nix @@ -0,0 +1,47 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # An instance of `pkgs` with your overlays and packages applied is also available. + pkgs, + # You also have access to your flake's inputs. + inputs, + + # Additional metadata is provided by Snowfall Lib. + namespace, # The namespace used for your flake, defaulting to "internal" if not set. + system, # The system architecture for this host (eg. `x86_64-linux`). + target, # The Snowfall Lib target for this system (eg. `x86_64-iso`). + format, # A normalized name for the system target (eg. `iso`). + virtual, # A boolean to determine whether this system is a virtual target using nixos-generators. + systems, # An attribute map of your defined hosts. + + # All other arguments come from the module system. + config, + ... +}: + +let + cfg = config.modules.locales; +in +{ + options.modules.locales = { + enable = lib.mkOption { default = false; }; + }; + + config = lib.mkIf cfg.enable { + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + }; +} diff --git a/systems/x86_64-linux/kardorf/default.nix b/systems/x86_64-linux/kardorf/default.nix index a34a2d5..a2e2f02 100644 --- a/systems/x86_64-linux/kardorf/default.nix +++ b/systems/x86_64-linux/kardorf/default.nix @@ -2,21 +2,35 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ lib, inputs, config, pkgs, ... }: { +{ + lib, + inputs, + config, + pkgs, + ... +}: +{ imports = [ ./hardware-configuration.nix ]; - nix.buildMachines = [{ - hostName = "192.168.3.118"; - system = "x86_64-linux"; - protocol = "ssh"; - # if the builder supports building for multiple architectures, - # replace the previous line by, e.g. - # systems = ["x86_64-linux" "aarch64-linux"]; - maxJobs = 4; - speedFactor = 3; - supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; - mandatoryFeatures = [ ]; - }]; + nix.buildMachines = [ + { + hostName = "192.168.3.118"; + system = "x86_64-linux"; + protocol = "ssh"; + # if the builder supports building for multiple architectures, + # replace the previous line by, e.g. + # systems = ["x86_64-linux" "aarch64-linux"]; + maxJobs = 4; + speedFactor = 3; + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; + mandatoryFeatures = [ ]; + } + ]; nix.distributedBuilds = true; # optional, useful when the builder has a faster internet connection than yours nix.extraOptions = " builders-use-substitutes = true\n"; @@ -27,7 +41,12 @@ boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.efiSysMountPoint = "/boot/efi"; - boot.supportedFilesystems = [ "btrfs" "ntfs" "nfs" "cifs" ]; + boot.supportedFilesystems = [ + "btrfs" + "ntfs" + "nfs" + "cifs" + ]; networking.hostName = "kardorf"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -47,38 +66,29 @@ location.latitude = 47.92; location.longitude = 10.12; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; + modules = { + locales.enable = true; }; nix.settings.auto-optimise-store = true; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; # Setup binary caches nix.settings = { - substituters = - [ "https://nix-community.cachix.org" "https://cache.nixos.org/" ]; - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org/" ]; + trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; # Enable the X11 windowing system. services.xserver.enable = true; services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia.package = - config.boot.kernelPackages.nvidiaPackages.legacy_470; + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; hardware.opengl.enable = true; # hardware.nvidia.modesetting.enable = true; # for wayland @@ -146,12 +156,15 @@ uid = 1000; group = "julian"; shell = pkgs.fish; - extraGroups = [ "networkmanager" "wheel" "docker" ]; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + ]; packages = with pkgs; [ ]; # Using home-manager instead }; - home-manager.useGlobalPkgs = - true; # make overlays for nixpkgs work for home-manager, not only the system + home-manager.useGlobalPkgs = true; # make overlays for nixpkgs work for home-manager, not only the system home-manager.useUserPackages = true; programs.fish.enable = true; @@ -159,7 +172,9 @@ programs.nix-ld.enable = true; - users.groups.julian = { gid = 1000; }; + users.groups.julian = { + gid = 1000; + }; # users.groups.wolfi = { gid = 1001; }; # users.users.wolfi = { @@ -171,10 +186,8 @@ # extraGroups = [ "networkmanager" "wheel" ]; # }; - environment.etc."manual-links/xfce4-notifyd".source = - "${pkgs.xfce.xfce4-notifyd}/lib/xfce4/notifyd/xfce4-notifyd"; - environment.etc."manual-links/polkit-gnome-authentication-agent-1".source = - "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + environment.etc."manual-links/xfce4-notifyd".source = "${pkgs.xfce.xfce4-notifyd}/lib/xfce4/notifyd/xfce4-notifyd"; + environment.etc."manual-links/polkit-gnome-authentication-agent-1".source = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; # List services that you want to enable: # Enable the OpenSSH daemon. @@ -202,7 +215,12 @@ # $ nix search wget # Packages needed as root - environment.systemPackages = with pkgs; [ vim htop mc home-manager ]; + environment.systemPackages = with pkgs; [ + vim + htop + mc + home-manager + ]; virtualisation.docker.enable = true; @@ -233,5 +251,4 @@ # 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 = "22.11"; # Did you read the comment? - } diff --git a/systems/x86_64-linux/pianonix/default.nix b/systems/x86_64-linux/pianonix/default.nix new file mode 100644 index 0000000..fe298a5 --- /dev/null +++ b/systems/x86_64-linux/pianonix/default.nix @@ -0,0 +1,135 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ + lib, + inputs, + config, + pkgs, + ... +}: +{ + imports = [ ./hardware-configuration.nix ]; + + # Bootloader + # Use this for simple nix boot menu, if no dual boot required + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + networking.networkmanager.enable = true; + networking.hostName = "pianonix"; # Define your hostname. + networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Set location used by redshift + location.provider = "manual"; + location.latitude = 47.92; + location.longitude = 10.12; + + modules = { + locales.enable = true; + }; + + nix.settings.auto-optimise-store = true; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # Setup binary caches + nix.settings = { + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org/" + ]; + trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + hardware.opengl.enable = true; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + # Enable the XFCE Desktop Environment. + services.xserver.displayManager.lightdm.enable = true; + services.xserver.desktopManager = { + xterm.enable = false; + xfce = { + enable = true; + noDesktop = true; + enableXfwm = false; + }; + }; + + # Configure keymap in X11 + services.xserver = { + xkb.layout = "de"; + xkb.variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.julian = { + isNormalUser = true; + description = "Julian"; + uid = 1000; + gid = 1000; + group = "julian"; + extraGroups = [ + "networkmanager" + "wheel" + "docker" + ]; + packages = with pkgs; [ ]; # Using home-manager instead + }; + + programs.nix-ld.enable = true; + + # List services that you want to enable: + services.openssh.enable = false; + + services.syncthing.enable = true; + services.syncthing.user = "julian"; + services.syncthing.group = "julian"; + + services.redshift.enable = true; + + services.gnome.gnome-keyring.enable = true; + + # Packages needed as root + environment.systemPackages = with pkgs; [ + vim + htop + mc + ]; + + # 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. It‘s 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 = "22.11"; # Did you read the comment? +}