From 151790a591fc9a6c9b153b1d514610e26d6bc87e Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 21 Jan 2023 20:04:37 +0530 Subject: 6.1.7 working --- flake.lock | 135 +++++------------------------ flake.nix | 38 +++++++-- home.nix | 10 +-- hosts/myrtle/configuration.nix | 145 ++++++++++++++++++++++++++++++++ hosts/myrtle/hardware-configuration.nix | 40 +++++++++ programs/init.vim | 14 +-- services/default.nix | 2 +- services/picom.nix | 1 - 8 files changed, 250 insertions(+), 135 deletions(-) create mode 100644 hosts/myrtle/configuration.nix create mode 100644 hosts/myrtle/hardware-configuration.nix diff --git a/flake.lock b/flake.lock index cb196f6..0f94912 100644 --- a/flake.lock +++ b/flake.lock @@ -22,87 +22,24 @@ "type": "github" } }, - "fenix_2": { - "inputs": { - "nixpkgs": [ - "statix", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src_2" - }, - "locked": { - "lastModified": 1645251813, - "narHash": "sha256-cQ66tGjnZclBCS3nD26mZ5fUH+3/HnysGffBiWXUSHk=", - "owner": "nix-community", - "repo": "fenix", - "rev": "9892337b588c38ec59466a1c89befce464aae7f8", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "prompt", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1635165013, - "narHash": "sha256-o/BdVjNwcB6jOmzZjOH703BesSkkS5O7ej3xhyO8hAY=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "5b9e0ff9d3b551234b4f3eb3983744fa354b17f1", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "gitignore_2": { - "inputs": { - "nixpkgs": [ - "statix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1635165013, - "narHash": "sha256-o/BdVjNwcB6jOmzZjOH703BesSkkS5O7ej3xhyO8hAY=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "5b9e0ff9d3b551234b4f3eb3983744fa354b17f1", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ "nixpkgs" - ] + ], + "utils": "utils" }, "locked": { - "lastModified": 1656169755, - "narHash": "sha256-Nlnm4jeQWEGjYrE6hxi/7HYHjBSZ/E0RtjCYifnNsWk=", + "lastModified": 1672244468, + "narHash": "sha256-xaZb8AZqoXRCSqPusCk4ouf+fUNP8UJdafmMTF1Ltlw=", "owner": "nix-community", "repo": "home-manager", - "rev": "4a3d01fb53f52ac83194081272795aa4612c2381", + "rev": "89a8ba0b5b43b3350ff2e3ef37b66736b2ef8706", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-22.05", + "ref": "release-22.11", "repo": "home-manager", "type": "github" } @@ -124,16 +61,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1662099760, - "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=", + "lastModified": 1674236650, + "narHash": "sha256-B4GKL1YdJnII6DQNNJ4wDW1ySJVx2suB1h/v4Ql8J0Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "67e45078141102f45eff1589a831aeaa3182b41e", + "rev": "cfb43ad7b941d9c3606fb35d91228da7ebddbfc5", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-22.05", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -141,17 +78,16 @@ "prompt": { "inputs": { "fenix": "fenix", - "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1643513342, - "narHash": "sha256-t819RkW5NiURx4lJlGMfHW3IuAMJtK29jUpAqUixKeg=", + "lastModified": 1662898783, + "narHash": "sha256-wh/sty5Gs7vwDcuNpxekI/7lzg7LEyQIQVAX0dMJTE8=", "ref": "refs/heads/master", - "rev": "8b1dd1f5609447f5d862e330a75a4b2a0dfc3929", - "revCount": 3, + "rev": "306640f502ef24e31590eef910b78ccd85ce8f6e", + "revCount": 5, "type": "git", "url": "https://git.peppe.rs/cli/prompt" }, @@ -165,8 +101,7 @@ "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", - "prompt": "prompt", - "statix": "statix" + "prompt": "prompt" } }, "rust-analyzer-src": { @@ -186,44 +121,20 @@ "type": "github" } }, - "rust-analyzer-src_2": { - "flake": false, + "utils": { "locked": { - "lastModified": 1645205556, - "narHash": "sha256-e4lZW3qRyOEJ+vLKFQP7m2Dxh5P44NrnekZYLxlucww=", - "owner": "rust-analyzer", - "repo": "rust-analyzer", - "rev": "acf5874b39f3dc5262317a6074d9fc7285081161", + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "type": "github" }, "original": { - "owner": "rust-analyzer", - "ref": "nightly", - "repo": "rust-analyzer", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } - }, - "statix": { - "inputs": { - "fenix": "fenix_2", - "gitignore": "gitignore_2", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1657460333, - "narHash": "sha256-5o6zMBASEsGKtjKDb3SizJnN9A7qpOcbzWBXsacfMyc=", - "ref": "refs/heads/master", - "rev": "6422c959d365dee2fda5eda8858fefad31f17b25", - "revCount": 129, - "type": "git", - "url": "https://git.peppe.rs/languages/statix" - }, - "original": { - "type": "git", - "url": "https://git.peppe.rs/languages/statix" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8293654..0d9692c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,19 +2,19 @@ description = "nerdypepper's nixos config"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixos-hardware.url = "github:nixos/nixos-hardware"; home-manager = { - url = "github:nix-community/home-manager/release-22.05"; + url = "github:nix-community/home-manager/release-22.11"; inputs.nixpkgs.follows = "nixpkgs"; }; - statix = { - url = "git+https://git.peppe.rs/languages/statix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + # statix = { + # url = "git+https://git.peppe.rs/languages/statix"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; prompt = { url = "git+https://git.peppe.rs/cli/prompt"; @@ -28,13 +28,13 @@ , nixpkgs , nixos-hardware , home-manager - , statix + # , statix , prompt , ... } @ inputs: { overlays = { - statix = statix.overlay; + # statix = statix.overlay; prompt = prompt.overlay; }; @@ -60,6 +60,28 @@ } ]; }; + + myrtle = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ({ config = { nix.registry.nixpkgs.flake = nixpkgs; }; }) + { + imports = [ ./hosts/myrtle/configuration.nix ]; + _module.args.self = self; + } + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.np = { + imports = [ ./home.nix ]; + _module.args.self = self; + _module.args.inputs = inputs; + _module.args.theme = import ./theme; + }; + } + ]; + }; }; }; diff --git a/home.nix b/home.nix index 92d6c81..b67a91d 100644 --- a/home.nix +++ b/home.nix @@ -11,10 +11,10 @@ ./programs ./services ./x - ./mail.nix + # ./mail.nix ]; - home.stateVersion = "21.05"; + home.stateVersion = "22.11"; home.username = "np"; home.homeDirectory = "/home/np"; home.extraOutputsToInstall = [ "man" ]; @@ -28,7 +28,6 @@ firefox xclip ripgrep - ccls miniserve rnix-lsp pfetch @@ -49,18 +48,17 @@ ripgrep-all urlview slop - gimp fd du-dust jq - stylish-haskell libnotify inotify-tools rtorrent sxiv lftp - zoom-us pavucontrol + cudatoolkit + pciutils # meta nixpkgs-review diff --git a/hosts/myrtle/configuration.nix b/hosts/myrtle/configuration.nix new file mode 100644 index 0000000..7539696 --- /dev/null +++ b/hosts/myrtle/configuration.nix @@ -0,0 +1,145 @@ +{ config, pkgs, lib, self, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking = { + hostName = "myrtle"; + wireless.enable = true; + wireless.networks.Srividhya.psk = "gopalan2020"; + }; + + + i18n.defaultLocale = "en_US.UTF-8"; + time.timeZone = "Asia/Kolkata"; + + nixpkgs.config = { + "2bwm".patches = [ + ../../patches/2bwm/nerd-patch.diff + ]; + + st = { + conf = builtins.readFile ../../programs/st/config.h; + extraLibs = with pkgs; [ harfbuzz ]; + patches = [ + ../../patches/st/xres.diff + ../../patches/st/bright.diff + ../../patches/st/ligatures.diff + ]; + }; + + # for zoom-us, nvidia + allowUnfree = true; + }; + + nixpkgs.overlays = with self.overlays; [ + # statix + prompt + ]; + + environment.systemPackages = with pkgs; [ + _2bwm + man-pages + man-pages-posix + (lib.hiPrio pkgs.bashInteractive_5) + ]; + + + documentation = { + dev.enable = true; + man.generateCaches = true; + }; + + users.motd = with config; '' + Host ${networking.hostName} + OS NixOS ${system.nixos.release} (${system.nixos.codeName}) + Version ${system.nixos.version} + Kernel ${boot.kernelPackages.kernel.version} + ''; + + programs = { + light.enable = true; + adb.enable = true; + }; + + sound.enable = true; + hardware = { + pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + extraConfig = "load-module module-bluetooth-policy auto_switch=2"; + }; + # opengl.enable = true; + bluetooth = { + enable = true; + powerOnBoot = true; + }; + # nvidia = { + # prime = { + # offload.enable = true; + # nvidiaBusId = "PCI:1:0:0"; + # intelBusId = "PCI:0:2:0"; + # }; + # }; + }; + + + services.xserver = { + enable = true; + layout = "us"; + videoDrivers = [ "nvidia" ]; + displayManager.startx.enable = true; + libinput.enable = true; + }; + + services.asusd = { + enable = true; + enableUserService = true; + }; + services.supergfxd.enable = true; + + users.users.np = { + isNormalUser = true; + home = "/home/np"; + extraGroups = [ "wheel" "users" "tty" "audio" "video" "input" "adbusers" "docker" ]; + }; + + nix = { + package = pkgs.nixUnstable; + extraOptions = '' + experimental-features = nix-command flakes + warn-dirty = false + keep-outputs = false + keep-derivations = false + ''; + settings = { + trusted-users = [ + "root" + "np" + ]; + }; + }; + + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # 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 = "23.05"; # Did you read the comment? + +} + diff --git a/hosts/myrtle/hardware-configuration.nix b/hosts/myrtle/hardware-configuration.nix new file mode 100644 index 0000000..86638d2 --- /dev/null +++ b/hosts/myrtle/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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" "thunderbolt" "vmd" "nvme" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/59c9ddc2-b914-414b-9e7e-74b405cbf3f6"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/7004-C5AE"; + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + # high-resolution display + hardware.video.hidpi.enable = lib.mkDefault true; +} diff --git a/programs/init.vim b/programs/init.vim index 4a822da..8cf3c9c 100644 --- a/programs/init.vim +++ b/programs/init.vim @@ -1,12 +1,12 @@ let &t_ZM = "\e[3m" -call plug#begin('~/.local/share/nvim/plugged') - -" my stuff -Plug 'git@ferrn:vim/vim-colors-plain' -Plug 'git@ferrn:vim/better-text-objs' - -call plug#end() +" call plug#begin('~/.local/share/nvim/plugged') +" +" " my stuff +" Plug 'git@ferrn:vim/vim-colors-plain' +" Plug 'git@ferrn:vim/better-text-objs' +" +" call plug#end() " augroups diff --git a/services/default.nix b/services/default.nix index 83955bf..dda2992 100644 --- a/services/default.nix +++ b/services/default.nix @@ -8,7 +8,7 @@ imports = [ ./dunst.nix - ./picom.nix + # ./picom.nix ./redshift.nix ./sxhkd.nix ./mbsync.nix diff --git a/services/picom.nix b/services/picom.nix index 67605d1..08ba376 100644 --- a/services/picom.nix +++ b/services/picom.nix @@ -10,7 +10,6 @@ fade = true; fadeDelta = 10; fadeSteps = [ "0.04" "0.04" ]; - inactiveDim = "0.0"; shadow = false; shadowOffsets = [ (-60) (-60) ]; shadowOpacity = "0.20"; -- cgit v1.2.3