From 4f6a1ccce2938857f8f851a89307548f61c00405 Mon Sep 17 00:00:00 2001 From: foglar Date: Sat, 14 Dec 2024 11:57:41 +0100 Subject: [PATCH] leanix configuration --- flake.nix | 41 +++++++++------- leanix/configuration.nix | 101 +++++++++++++++++++++++++++++++++++++++ leanix/home.nix | 26 ++++++++++ 3 files changed, 152 insertions(+), 16 deletions(-) create mode 100644 leanix/configuration.nix create mode 100644 leanix/home.nix diff --git a/flake.nix b/flake.nix index 94171e2..7266bd3 100644 --- a/flake.nix +++ b/flake.nix @@ -3,32 +3,31 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11"; - nix-ld.url = "github:Mic92/nix-ld"; - nix-ld.inputs.nixpkgs.follows = "nixpkgs"; + stylix.url = "github:danth/stylix"; + hyprland.url = "github:hyprwm/Hyprland"; - hyprland = { - url = "github:hyprwm/Hyprland"; + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; }; - #hyprland-plugins = { - # url = "github:hyprwm/hyprland-plugins"; - # inputs.hyprland.follows = "hyprland"; - #}; - - #Hyprspace = { - # url = "github:KZDKM/Hyprspace"; - # # Hyprspace uses latest Hyprland. We declare this to keep them in sync. - # inputs.hyprland.follows = "hyprland"; - #}; + nix-ld = { + url = "github:Mic92/nix-ld"; + inputs.nixpkgs.follows = "nixpkgs"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; - stylix.url = "github:danth/stylix"; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; @@ -71,10 +70,20 @@ modules = [ ./nixos/configuration.nix + inputs.stylix.nixosModules.stylix inputs.nix-ld.nixosModules.nix-ld ]; }; + leanix = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs system pkgs-stable; + }; + + modules = [ + ./leanix/configuration.nix + ]; + }; }; }; } diff --git a/leanix/configuration.nix b/leanix/configuration.nix new file mode 100644 index 0000000..cb2ed2f --- /dev/null +++ b/leanix/configuration.nix @@ -0,0 +1,101 @@ +{ + inputs, + lib, + pkgs, + pkgs-stable, + ... +}: { + imports = [ + ./hardware-configuration.nix + ../nixos/system/packages.nix + ../nixos/system/system.nix + inputs.home-manager.nixosModules.home-manager + ]; + + nix.settings.experimental-features = ["nix-command" "flakes"]; + + inputs.home-manager = { + extraSpecialArgs = {inherit inputs pkgs pkgs-stable;}; + backupFileExtension = "backup"; + users = { + konsta = import ./home.nix; + }; + }; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + + environment.sessionVariables = { + FLAKE = "/home/konsta/.dotfiles"; + + DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox"; + }; + + users.users.konsta = { + isNormalUser = true; + description = "konsta"; + extraGroups = ["wheel"]; + }; + + + sys = { + audio.enable = true; + desktop = { + plasma.enable = false; + gnome.enable = true; + hyprland.enable = false; + }; + fonts.packages = true; + locales.enable = true; + network.enable = true; + bluetooth.enable = true; + nvidia.enable = false; + printing.enable = false; + sddm.enable = false; + style.enable = true; + }; + + package = { + docker.enable = false; + steam.enable = false; + proxychains.enable = false; + tor.enable = false; + virt-manager.enable = false; + }; + desktop.steamdeck.enable = false; + programs.kdeconnect.enable = true; + programs.wireshark.enable = false; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. 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 = "24.11"; # Did you read the comment? +} diff --git a/leanix/home.nix b/leanix/home.nix new file mode 100644 index 0000000..d8b94f3 --- /dev/null +++ b/leanix/home.nix @@ -0,0 +1,26 @@ +{lib, ...}: { + home.username = "konsta"; + home.homeDirectory = "/home/konsta"; + home.stateVersion = "24.11"; # Please read the comment before changing. + + imports = [ + ../nixos/packages/packages.nix + ]; + + program.firefox.enable = lib.mkDefault true; + + group.terminal_tools.enable = true; + + program = { + kitty.enable = lib.mkDefault false; + tmux.enable = lib.mkDefault false; + zoxide.enable = lib.mkDefault false; + }; + + sh.bash = { + enable = lib.mkDefault true; + oh-my-posh.enable = lib.mkDefault false; + }; + + programs.home-manager.enable = true; +}