activation: Set the permissions of /etc/sudoers to 440.
[jackhill/guix/guix.git] / gnu / system / file-systems.scm
CommitLineData
c5df1839
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu system file-systems)
20 #:use-module (guix records)
21 #:export (<file-system>
22 file-system
23 file-system?
24 file-system-device
d4c87617 25 file-system-title
c5df1839
LC
26 file-system-mount-point
27 file-system-type
28 file-system-needed-for-boot?
29 file-system-flags
30 file-system-options
4e469051
LC
31 file-system-check?
32 file-system-create-mount-point?
c5df1839
LC
33
34 %fuse-control-file-system
a69576ea 35 %binary-format-file-system
705f8b68
MW
36 %shared-memory-file-system
37 %pseudo-terminal-file-system
a69576ea
LC
38 %devtmpfs-file-system
39
40 %base-file-systems))
c5df1839
LC
41
42;;; Commentary:
43;;;
44;;; Declaring file systems to be mounted.
45;;;
46;;; Code:
47
48;; File system declaration.
49(define-record-type* <file-system> file-system
50 make-file-system
51 file-system?
52 (device file-system-device) ; string
d4c87617
LC
53 (title file-system-title ; 'device | 'label | 'uuid
54 (default 'device))
c5df1839
LC
55 (mount-point file-system-mount-point) ; string
56 (type file-system-type) ; string
57 (flags file-system-flags ; list of symbols
58 (default '()))
59 (options file-system-options ; string or #f
60 (default #f))
61 (needed-for-boot? file-system-needed-for-boot? ; Boolean
62 (default #f))
63 (check? file-system-check? ; Boolean
4e469051
LC
64 (default #t))
65 (create-mount-point? file-system-create-mount-point? ; Boolean
66 (default #f)))
c5df1839
LC
67
68(define %fuse-control-file-system
69 ;; Control file system for Linux' file systems in user-space (FUSE).
70 (file-system
71 (device "fusectl")
72 (mount-point "/sys/fs/fuse/connections")
73 (type "fusectl")
74 (check? #f)))
75
76(define %binary-format-file-system
77 ;; Support for arbitrary executable binary format.
78 (file-system
79 (device "binfmt_misc")
80 (mount-point "/proc/sys/fs/binfmt_misc")
81 (type "binfmt_misc")
82 (check? #f)))
83
a69576ea
LC
84(define %devtmpfs-file-system
85 ;; /dev as a 'devtmpfs' file system, needed for udev.
86 (file-system
87 (device "none")
88 (mount-point "/dev")
89 (type "devtmpfs")
7f239fd3
LC
90 (check? #f)
91
92 ;; Mount it from the initrd so /dev/pts & co. can then be mounted over it.
93 (needed-for-boot? #t)))
94
95(define %tty-gid
96 ;; ID of the 'tty' group. Allocate it statically to make it easy to refer
97 ;; to it from here and from the 'tty' group definitions.
c8fa3426 98 996)
7f239fd3
LC
99
100(define %pseudo-terminal-file-system
101 ;; The pseudo-terminal file system. It needs to be mounted so that
102 ;; statfs(2) returns DEVPTS_SUPER_MAGIC like libc's getpt(3) expects (and
103 ;; thus openpty(3) and its users, such as xterm.)
104 (file-system
105 (device "none")
106 (mount-point "/dev/pts")
107 (type "devpts")
108 (check? #f)
109 (needed-for-boot? #f)
110 (create-mount-point? #t)
111 (options (string-append "gid=" (number->string %tty-gid) ",mode=620"))))
a69576ea 112
db17ae5c
LC
113(define %shared-memory-file-system
114 ;; Shared memory.
115 (file-system
116 (device "tmpfs")
117 (mount-point "/dev/shm")
118 (type "tmpfs")
119 (check? #f)
120 (flags '(no-suid no-dev))
121 (options "size=50%") ;TODO: make size configurable
122 (create-mount-point? #t)))
123
a69576ea
LC
124(define %base-file-systems
125 ;; List of basic file systems to be mounted. Note that /proc and /sys are
126 ;; currently mounted by the initrd.
7f239fd3 127 (list %devtmpfs-file-system
db17ae5c
LC
128 %pseudo-terminal-file-system
129 %shared-memory-file-system))
a69576ea 130
c5df1839 131;;; file-systems.scm ends here