Skip to content

Commit

Permalink
Add some stuff for the laptop
Browse files Browse the repository at this point in the history
  • Loading branch information
billy4479 committed Dec 27, 2023
1 parent 790833e commit fdcddd1
Show file tree
Hide file tree
Showing 16 changed files with 1,166 additions and 16 deletions.
28 changes: 22 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
catppuccin.url = "github:Stonks3141/ctp-nix";

home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = { self, nixpkgs, home-manager, ... }:
outputs = { self, nixpkgs, home-manager, catppuccin, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
Expand All @@ -36,12 +37,23 @@
./system/vm
];
};
portatilo = nixos {
inherit system;
specialArgs = extraArgs;
modules = [
./system
./system/portatilo
];
};
};
homeConfigurations = {
billy = hmCfg {
inherit pkgs;
extraSpecialArgs = extraArgs;
modules = [ ./user ];
modules = [
catppuccin.homeManagerModules.catppuccin
./user
];
};
};
};
Expand Down
6 changes: 4 additions & 2 deletions system/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
# Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];

# Enable unfree
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowUnfreePredicate = _: true;

# Enable networking
networking.networkmanager.enable = true;

Expand All @@ -43,8 +47,6 @@
fullName = user.fullName;
};

nixpkgs.config.allowUnfree = true;

# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
Expand Down
21 changes: 21 additions & 0 deletions system/portatilo/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ pkgs, ... }:

{
imports = [
./hardware-configuration.nix
];

networking.hostName = "portatilo";

hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
];
};

services.xserver.displayManager.autoLogin = {
enable = true;
user = "billy";
};
}
42 changes: 42 additions & 0 deletions system/portatilo/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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" "nvme" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];

fileSystems."/" =
{
device = "/dev/disk/by-uuid/3200a97f-37c7-4b82-bcfb-76a04d0997cb";
fsType = "ext4";
};

boot.initrd.luks.devices."luks-58babcf8-8b63-41ad-a052-5ba95810a8a4".device = "/dev/disk/by-uuid/58babcf8-8b63-41ad-a052-5ba95810a8a4";

fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/0247-0569";
fsType = "vfat";
};

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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
4 changes: 4 additions & 0 deletions user/browser/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{ ... }:
{
imports = [ ./firefox-based ];
}
36 changes: 36 additions & 0 deletions user/browser/firefox-based/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ ... }@args:
let
aboutConfig = {
# Lets be honest, this is more annoying than useful
"webgl.disabled" = false;
"privacy.resistFingerprinting" = false;
"extensions.pocket.enabled" = false;

# Keep history
"privacy.clearOnShutdown.history" = false;
"privacy.clearOnShutdown.downloads" = false;

# Firefox Sync
"identity.fxaccounts.enabled" = true;

# Autoscroll
"middlemouse.paste" = false;
"general.autoScroll" = true;

# Search engine
"browser.search.separatePrivateDefault" = false;
"browser.search.suggest.enabled" = true;
"browser.urlbar.suggest.searches" = true;

"browser.aboutConfig.showWarning" = false;
"browser.bookmarks.addedImportButton" = true;
"browser.topsites.contile.cachedTiles" = "";
"browser.uiCustomization.state" = builtins.readFile ./ui-state.json;
};
in
{
imports = [
(import ./firefox.nix (args // { inherit aboutConfig; }))
# (import ./librewolf.nix (args // {inherit aboutConfig;}))
];
}
21 changes: 21 additions & 0 deletions user/browser/firefox-based/firefox.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ aboutConfig, user, ... }:
{
programs.firefox = {
enable = true;
profiles.${user.username} = {
id = 0;
search = {
default = "Brave Search";
engines = {
"Brave Search" = {
urls = [{ template = "https://search.brave.com/search?q={searchTerms}"; }];
iconUpdateURL = "https://brave.com/static-assets/images/brave-logo-sans-text.svg";
updateInterval = 24 * 60 * 60 * 1000; # every day
};
};
force = true;
};
settings = aboutConfig;
};
};
}
10 changes: 10 additions & 0 deletions user/browser/firefox-based/librewolf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ aboutConfig, ... }:

{
programs.librewolf = {
enable = true;

# https://librewolf.net/docs/settings
settings = aboutConfig;
};
}
68 changes: 68 additions & 0 deletions user/browser/firefox-based/ui-state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"placements": {
"widget-overflow-fixed-list": [],
"unified-extensions-area": [
"sponsorblocker_ajay_app-browser-action",
"_cb31ec5d-c49a-4e5a-b240-16c767444f62_-browser-action",
"_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action",
"_a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7_-browser-action",
"idcac-pub_guus_ninja-browser-action",
"_e7625f06-e252-479d-ac7a-db68aeaff2cb_-browser-action",
"addon_fastforward_team-browser-action",
"canvasblocker_kkapsner_de-browser-action",
"firefoxcolor_mozilla_com-browser-action",
"tab-session-manager_sienori-browser-action",
"savepage-we_dw-dev-browser-action",
"_74145f27-f039-47ce-a470-a662b129930a_-browser-action",
"_7a7a4a92-a2a0-41d1-9fd7-1e92480d612d_-browser-action",
"gdpr_cavi_au_dk-browser-action",
"jid1-y3wfe7td45awdw_jetpack-browser-action",
"_278b0ae0-da9d-4cc6-be81-5aa7f3202672_-browser-action"
],
"nav-bar": [
"back-button",
"forward-button",
"stop-reload-button",
"urlbar-container",
"save-to-pocket-button",
"downloads-button",
"unified-extensions-button",
"ublock0_raymondhill_net-browser-action",
"addon_darkreader_org-browser-action",
"_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action"
],
"toolbar-menubar": ["menubar-items"],
"TabsToolbar": ["tabbrowser-tabs", "new-tab-button", "alltabs-button"],
"PersonalToolbar": ["personal-bookmarks"]
},
"seen": [
"developer-button",
"_cb31ec5d-c49a-4e5a-b240-16c767444f62_-browser-action",
"_aecec67f-0d10-4fa7-b7c7-609a2db280cf_-browser-action",
"_a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7_-browser-action",
"addon_darkreader_org-browser-action",
"idcac-pub_guus_ninja-browser-action",
"ublock0_raymondhill_net-browser-action",
"_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action",
"_e7625f06-e252-479d-ac7a-db68aeaff2cb_-browser-action",
"addon_fastforward_team-browser-action",
"canvasblocker_kkapsner_de-browser-action",
"firefoxcolor_mozilla_com-browser-action",
"tab-session-manager_sienori-browser-action",
"savepage-we_dw-dev-browser-action",
"_74145f27-f039-47ce-a470-a662b129930a_-browser-action",
"_7a7a4a92-a2a0-41d1-9fd7-1e92480d612d_-browser-action",
"sponsorblocker_ajay_app-browser-action",
"gdpr_cavi_au_dk-browser-action",
"jid1-y3wfe7td45awdw_jetpack-browser-action",
"_278b0ae0-da9d-4cc6-be81-5aa7f3202672_-browser-action"
],
"dirtyAreaCache": [
"nav-bar",
"PersonalToolbar",
"unified-extensions-area",
"TabsToolbar"
],
"currentVersion": 20,
"newElementCount": 4
}
23 changes: 17 additions & 6 deletions user/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,29 @@
imports = [
./shell
./git.nix
./browser
./fonts
];

home.stateVersion = "23.11";

catppuccin = {
flavour = "frappe";
accent = "green";
};

programs = {
zathura = {
enable = true;
catppuccin.enable = true;
};
};

home.packages = with pkgs; [
librewolf
neovim

# Fonts
(nerdfonts.override {
fonts = [ "FiraCode" ];
})
fd
ripgrep
p7zip
];

home.file = { };
Expand Down
Loading

0 comments on commit fdcddd1

Please sign in to comment.