Guest User

Untitled

a guest
Mar 12th, 2022
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 7.24 KB | None | 0 0
  1.  
  2. (use-modules
  3.   (gnu)
  4.   (nongnu packages linux)
  5.   (nongnu packages nvidia)
  6.   (gnu packages xorg)
  7.   (nongnu system linux-initrd)
  8.   (guix transformations)
  9.   (gnu packages gnome)
  10.   (gnu packages haskell-apps)
  11.   (gnu packages shells))
  12.  
  13. (use-service-modules
  14.   cups
  15.   desktop
  16.   docker
  17.   linux
  18.   networking
  19.   nix
  20.   ssh
  21.   virtualization
  22.   xorg)
  23.  
  24. (use-package-modules package-management)
  25.  
  26. (define transform
  27.   (options->transformation
  28.    '((with-graft . "mesa=nvda"))))
  29.  
  30. ;; Allow members of the "video" group to change the screen brightness.
  31. (define %backlight-udev-rule
  32.   (udev-rule
  33.    "90-backlight.rules"
  34.    (string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", "
  35.                   "RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\""
  36.                   "\n"
  37.                   "ACTION==\"add\", SUBSYSTEM==\"backlight\", "
  38.                   "RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\"")))
  39.  
  40. (define %my-desktop-services
  41.   (modify-services %desktop-services
  42.                    (delete gdm-service-type)
  43.                    (elogind-service-type config =>
  44.                                          (elogind-configuration (inherit config)
  45.                                                                 (handle-lid-switch-external-power 'suspend)))
  46.                    (udev-service-type config =>
  47.                            (udev-configuration (inherit config)
  48.                            (rules (cons kmonad
  49.                                        (udev-configuration-rules config)))))
  50.                    (udev-service-type config =>
  51.                                       (udev-configuration (inherit config)
  52.                                                           (rules (cons %backlight-udev-rule
  53.                                                                        (udev-configuration-rules config)))))
  54.                    (network-manager-service-type config =>
  55.                                                  (network-manager-configuration (inherit config)
  56.                                                                                 (vpn-plugins (list network-manager-openvpn))))))
  57.  
  58. (define %xorg-config
  59.     "Section \"Device\"
  60.        Identifier     \"Device0\"
  61.        Driver         \"nvidia\"
  62.        VendorName     \"NVIDIA Corporation\"
  63.        BoardName      \"GeForce GTX 1050 Ti\"
  64.    EndSection
  65.  
  66.    Section \"ServerFlags\"
  67.        Option \"IgnoreABI\" \"1\"
  68.    EndSection
  69.  
  70.    Section \"Device\"
  71.        Identifier  \"intel\"
  72.        Driver      \"modesetting\"
  73.    EndSection
  74.  
  75.    Section \"Screen\"
  76.        Identifier \"intel\"
  77.        Device \"intel\"
  78.    EndSection
  79.  
  80.    Section \"InputClass\"
  81.        Identifier \"Touchpads\"
  82.        Driver \"libinput\"
  83.        MatchDevicePath \"/dev/input/event*\"
  84.        MatchIsTouchpad \"on\"
  85.  
  86.        Option \"Tapping\" \"on\"
  87.        Option \"TappingDrag\" \"on\"
  88.        Option \"DisableWhileTyping\" \"on\"
  89.        Option \"MiddleEmulation\" \"on\"
  90.        Option \"ScrollMethod\" \"twofinger\"
  91.    EndSection
  92.  
  93.    Section \"InputClass\"
  94.        Identifier \"Keyboards\"
  95.        Driver \"libinput\"
  96.        MatchDevicePath \"/dev/input/event*\"
  97.        MatchIsKeyboard \"on\"
  98.    EndSection
  99. ")
  100.  
  101. (operating-system
  102.   (kernel linux-lts)
  103.   (initrd microcode-initrd)
  104.   (firmware (list linux-firmware))
  105.   (kernel-arguments
  106.    (append '("modprobe.blacklist=nouveau")
  107.            %default-kernel-arguments))
  108.   (kernel-loadable-modules (list nvidia-driver))
  109.   (locale "en_US.utf8")
  110.   (timezone "Europe/Warsaw")
  111.   (keyboard-layout
  112.     (keyboard-layout "pl" "colemak"))
  113.   (host-name "jimi")
  114.   (users (cons* (user-account
  115.                   (name "m")
  116.                   (comment "Marcin")
  117.                   (group "users")
  118.                   (home-directory "/home/m")
  119.                   (shell (file-append zsh "/bin/zsh"))
  120.                   (supplementary-groups
  121.                     '("wheel" "netdev" "audio" "video" "docker" "kvm" "lp")))
  122.                 %base-user-accounts))
  123.   (packages
  124.     (append
  125.       (list (specification->package "i3-wm")
  126.             (specification->package "i3status")
  127.             (specification->package "dmenu")
  128.             (specification->package "git")
  129.             (specification->package "ripgrep")
  130.             (specification->package "fd")
  131.             (specification->package "exa")
  132.             (specification->package "nix")
  133.             (specification->package "st")
  134.             (specification->package "emacs")
  135.             (specification->package "emacs-guix")
  136.             (specification->package "emacs-exwm")
  137.             (specification->package
  138.               "emacs-desktop-environment")
  139.             (specification->package "nss-certs"))
  140.       %base-packages))
  141.   (services
  142.     (append
  143.       (list
  144.        ;;(service gnome-desktop-service-type)
  145.             (simple-service
  146.               'custom-udev-rules udev-service-type
  147.               (list nvidia-driver))
  148.             (service kernel-module-loader-service-type
  149.              '("ipmi_devintf"
  150.                "nvidia"
  151.                "nvidia_modeset"
  152.                ; "nvidia-drm"
  153.                "nvidia_uvm"))
  154.             (service openssh-service-type)
  155.             (service docker-service-type)
  156.             (service tor-service-type)
  157.             (service cups-service-type)
  158.             (service slim-service-type
  159.                 (slim-configuration
  160.                   (display ":1")
  161.                   (vt "vt7")
  162.                   (xorg-configuration (xorg-configuration
  163.                     (keyboard-layout keyboard-layout)
  164.                     (modules (cons* nvidia-driver %default-xorg-modules))
  165.                     (server (transform xorg-server))
  166.                     (drivers '("nvidia" "modesetting"))
  167.                     (extra-config (list %xorg-config ))))))
  168.             (service nix-service-type)
  169.             (service libvirt-service-type
  170.               (libvirt-configuration
  171.                 (unix-sock-group "libvirt")
  172.                 (tls-port "16555")))
  173.            (bluetooth-service #:auto-enable? #t))
  174.       %my-desktop-services))
  175.   (bootloader
  176.     (bootloader-configuration
  177.       (bootloader grub-efi-bootloader)
  178.       (targets (list "/boot/efi"))
  179.       (keyboard-layout keyboard-layout)))
  180.   (swap-devices
  181.     (list (uuid "3c5856e1-58dc-4f3a-b9d7-899053392f66")))
  182.   (mapped-devices
  183.     (list (mapped-device
  184.             (source
  185.               (uuid "053b59e9-8bad-4ea2-9043-f13ef815fa9c"))
  186.             (target "crypthome")
  187.             (type luks-device-mapping))
  188.           (mapped-device
  189.             (source
  190.               (uuid "38fba3f8-7406-47e0-ba97-b759463419e9"))
  191.             (target "cryptroot")
  192.             (type luks-device-mapping))))
  193.   (file-systems
  194.     (cons* (file-system
  195.              (mount-point "/home")
  196.              (device "/dev/mapper/crypthome")
  197.              (type "ext4")
  198.              (dependencies mapped-devices))
  199.            (file-system
  200.              (mount-point "/boot/efi")
  201.              (device (uuid "D16D-0E1D" 'fat32))
  202.              (type "vfat"))
  203.            (file-system
  204.              (mount-point "/")
  205.              (device "/dev/mapper/cryptroot")
  206.              (type "ext4")
  207.              (dependencies mapped-devices))
  208.            %base-file-systems)))
Advertisement
Add Comment
Please, Sign In to add comment