commit 06cb8c1e4807c15a9e3194e92be822ecf2e532c0 Author: Lily Anderson Date: Sun Oct 12 10:17:09 2025 -0500 First Commit. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a158983 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760015796, + "narHash": "sha256-c/WkaynHrRE1EHWATe5+vb9M9YabfTaR1GHivdybaSU=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "6564ee29d0521af3feba937a91024e6a3e77a8b6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1759831965, + "narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c9b6fb798541223bbb396d287d16f43520250518", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e4c79d8 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Lily's NixOS Flake. LiNix"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, home-manager }@inputs: { + + packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello; + + packages.x86_64-linux.default = self.packages.x86_64-linux.hello; + + nixosConfigurations = { + lily-desktop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./hosts/desktop/configuration.nix + inputs.home-manager.nixosModules.default + ]; + specialArgs = { inherit inputs; }; + }; + }; + }; +} diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix new file mode 100644 index 0000000..a15b805 --- /dev/null +++ b/hosts/desktop/configuration.nix @@ -0,0 +1,130 @@ +{ config, pkgs, inputs, ... }: +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../modules/nixos/localization.nix + ../../modules/nixos/ai/index.nix + ../../modules/nixos/gnome/gnome.nix + inputs.home-manager.nixosModules.default + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "lily-desktop"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Enable the X11 windowing system. + services.xserver.enable = true; + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + 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; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.lily = { + isNormalUser = true; + description = "Lily Iliana Luna Ylva Anderson Appleseed Grigaitis"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + # thunderbird + ]; + }; + + home-manager = { + extraSpecialArgs = { inherit inputs; }; + users = { + "lily" = import ./home.nix; + }; + }; + +programs.nh = { + enable = true; + flake = "/home/lily/Programming/New LiNix"; +}; + + + +nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Install firefox. + programs.firefox.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + +tree +htop +nvtopPackages.full +libreoffice-fresh +hunspell +hunspellDicts.en_US +hunspellDicts.en_US-large + +nh + +steam-run + +git + ]; + + # 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 = [ 22 ]; + # 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 = "25.05"; # Did you read the comment? + +} diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix new file mode 100644 index 0000000..d26009a --- /dev/null +++ b/hosts/desktop/hardware-configuration.nix @@ -0,0 +1,57 @@ +# 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" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ "nvidia" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ + config.boot.kernelPackages.nvidiaPackages.stable +]; + +hardware.graphics = { + enable = true; + enable32Bit = true; + }; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = false; + open = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + + + fileSystems."/" = + { device = "/dev/disk/by-uuid/8279665b-b695-4747-9206-9cc06b7fe303"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + boot.initrd.luks.devices."luks-8573b24b-461f-40bf-b16b-9de1207c0696".device = "/dev/disk/by-uuid/8573b24b-461f-40bf-b16b-9de1207c0696"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/383D-97DA"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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.enp42s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix new file mode 100644 index 0000000..b6ec8e5 --- /dev/null +++ b/hosts/desktop/home.nix @@ -0,0 +1,76 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "lily"; + home.homeDirectory = "/home/lily"; + + # 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 = "25.05"; # Please read the comment before changing. + + # 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 = [ "FantasqueSansMono" ]; }) + + # # 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. + # ".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'. 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/lily/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + # EDITOR = "emacs"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/modules/nixos/ai/index.nix b/modules/nixos/ai/index.nix new file mode 100644 index 0000000..047091c --- /dev/null +++ b/modules/nixos/ai/index.nix @@ -0,0 +1,8 @@ +{ config, pkgs, inputs, ... }: +{ + imports = [ + ./ollama.nix + ./open-webui.nix + ./sillytavern.nix + ]; +} diff --git a/modules/nixos/ai/ollama.nix b/modules/nixos/ai/ollama.nix new file mode 100644 index 0000000..1e3898b --- /dev/null +++ b/modules/nixos/ai/ollama.nix @@ -0,0 +1,10 @@ +{ config, pkgs, inputs, ... }: +{ + imports = [ ]; + services.ollama = { + enable = true; + acceleration = "cuda"; + host = "0.0.0.0"; + openFirewall = true; + }; +} diff --git a/modules/nixos/ai/open-webui.nix b/modules/nixos/ai/open-webui.nix new file mode 100644 index 0000000..fa971de --- /dev/null +++ b/modules/nixos/ai/open-webui.nix @@ -0,0 +1,18 @@ +{ config, pkgs, inputs, ... }: +{ + imports = [ ]; + services.open-webui = { + #enable = true; + enable = false; + host = "0.0.0.0"; + openFirewall = true; + port = 9001; + environment = + { + ANONYMIZED_TELEMETRY = "False"; + DO_NOT_TRACK = "True"; + SCARF_NO_ANALYTICS = "True"; + ENABLE_LOGIN_FORM = "True"; + }; + }; + } diff --git a/modules/nixos/ai/sillytavern.nix b/modules/nixos/ai/sillytavern.nix new file mode 100644 index 0000000..53cd3b8 --- /dev/null +++ b/modules/nixos/ai/sillytavern.nix @@ -0,0 +1,31 @@ +{ config, pkgs, inputs, ... }: +{ + imports = [ ]; + services.sillytavern = { + enable = true; + #enable = false; + port = 9002; + listen = true; + listenAddressIPv4 = "127.0.0.1"; + whitelist = true; + #user = "tavern"; + #group = "tavern"; + }; + + services.nginx = { + enable = true; + #additionalModules = [ pkgs.nginxModules.pam ]; + virtualHosts."192.168.0.101" = { + locations."/" = { + proxyPass = "http://localhost:9002"; + extraConfig = '' + auth_basic "Password Required"; + auth_basic_user_file /etc/htpasswd; + ''; + }; + }; + }; + + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ 80 ]; #9002 +} diff --git a/modules/nixos/gnome/.gnome.nix.swp b/modules/nixos/gnome/.gnome.nix.swp new file mode 100644 index 0000000..8af368e Binary files /dev/null and b/modules/nixos/gnome/.gnome.nix.swp differ diff --git a/modules/nixos/gnome/gnome.nix b/modules/nixos/gnome/gnome.nix new file mode 100644 index 0000000..387990a --- /dev/null +++ b/modules/nixos/gnome/gnome.nix @@ -0,0 +1,36 @@ +{ config, pkgs, inputs, ... }: +{ + imports = [ ]; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + #Disable Suspend + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; + + # Enable the GNOME Desktop Environment. + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; + + #Packages + environment.systemPackages = with pkgs; [ + gnome-tweaks + gnome-extension-manager + gnomeExtensions.pop-shell + gnomeExtensions.arcmenu + gnomeExtensions.dash-to-panel + gnomeExtensions.dash-to-dock + gnomeExtensions.just-perfection + gnomeExtensions.blur-my-shell + ]; + + environment.gnome.excludePackages = with pkgs; [ + epiphany + geary + gnome-tour + ]; + +} diff --git a/modules/nixos/localization.nix b/modules/nixos/localization.nix new file mode 100644 index 0000000..57a543d --- /dev/null +++ b/modules/nixos/localization.nix @@ -0,0 +1,29 @@ +{ config, pkgs, inputs, ... }: +{ + imports = + [ ]; + # Set your time zone. + time.timeZone = "America/Chicago"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + +} diff --git a/result b/result new file mode 120000 index 0000000..c03397b --- /dev/null +++ b/result @@ -0,0 +1 @@ +/nix/store/hg9rksm70al34r4q52r6207ns9y07h62-nixos-system-lily-desktop-25.11.20251007.c9b6fb7 \ No newline at end of file