Skip to content

Instantly share code, notes, and snippets.

@robrotheram
Created June 28, 2024 19:42
Show Gist options
  • Save robrotheram/8be848e5309dc5e943661ae168d6e7df to your computer and use it in GitHub Desktop.
Save robrotheram/8be848e5309dc5e943661ae168d6e7df to your computer and use it in GitHub Desktop.
home.nix
{ config, pkgs, ... }:
{
documentation.nixos.enable = false;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
networking.hostName = "nixos"; # Define your hostname.
networking.nameservers = [ "192.168.0.243" ];
nixpkgs.config.allowUnfree = true;
# Enable OpenGL
hardware.opengl = {
enable = true;
};
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
environment.systemPackages = with pkgs; [
htop
fastfetch
vscode
steam
steam-run
warp-terminal
prismlauncher
ulauncher
git
vim
wget
curl
];
services.flatpak.enable = true;
services.openssh.enable = true;
services.tailscale.enable = true;
services.flatpak.update.onActivation = true;
services.flatpak.packages = [
"com.obsproject.Studio"
"org.onlyoffice.desktopeditors"
"im.riot.Riot"
"md.obsidian.Obsidian"
"io.github.alainm23.planify"
"io.gitlab.news_flash.NewsFlash"
"io.github.elevenhsoft.WebApps"
"com.spotify.Client"
"com.discordapp.Discord"
"dev.skynomads.Seabird"
"org.darktable.Darktable"
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
}
{
inputs = {
tailscale.url = "https://flakehub.com/f/tailscale/tailscale/1.68.1.tar.gz";
nix-flatpak.url = "https://flakehub.com/f/gmodena/nix-flatpak/0.4.1.tar.gz";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, tailscale, nix-flatpak, nixos-cosmic, ... }@inputs: {
# Please replace my-nixos with your hostname
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
# Import the previous configuration.nix we used,
# so the old configuration file still takes effect
nix-flatpak.nixosModules.nix-flatpak
{
nix.settings = {
substituters = [ "https://cosmic.cachix.org/" ];
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
};
}
nixos-cosmic.nixosModules.default
./configuration.nix
./desktop.nix
];
};
};
}
{ config, pkgs, ... }:{
home.username = "robert";
home.homeDirectory = "/home/robert";
home.stateVersion = "24.05"; # Please read the comment before changing.
nixpkgs.config.allowUnfree = true;
home.packages = with pkgs; [];
programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
dracula-theme.theme-dracula
vscodevim.vim
yzhang.markdown-all-in-one
];
};
programs.chromium = {
enable = true;
package = pkgs.brave;
extensions = [
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # ublock origin
{ id = "nngceckbapebfimnlniiiahkandclblb"; } # bitwarden
];
commandLineArgs = [
"--disable-features=WebRtcAllowInputVolumeAdjustment"
];
};
home.file = {};
home.sessionVariables = {};
programs.home-manager.enable = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment